TOML to JSON
Processed Client SideConvert TOML config into JSON and back, in either direction, entirely in your browser.
Bookmark this tool now — skip the search next time you need it.
About TOML to JSON
This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.
The TOML to JSON converter reads a TOML configuration file and gives you the equivalent JSON, or takes JSON and writes it back out as TOML. TOML is what Cargo, pyproject.toml, Hugo, and a long list of CLI tools use for configuration, while JSON is what most code, APIs, and scripts actually want, so this is the bridge between the two. Tables, dotted keys, arrays of tables, inline tables, multi-line strings and arrays, and typed values all convert, and the direction flips with one button that carries the current output across as the new input. Both panes are syntax highlighted and everything runs in your browser.
Key features
- Bidirectional TOML and JSON conversion, with a swap button that feeds the output back in as the next input
- Handles tables, dotted keys, arrays of tables, and inline tables
- Typed values are preserved: integers, floats, booleans, and both basic and literal strings, including the multi-line forms
- Multi-line arrays, quoted keys, and dotted keys parsed reliably
- Comments are dropped on the way into JSON, since JSON has nowhere to put them
- Invalid input is reported with the line that failed rather than a generic error
- Both panes are syntax highlighted and swap language with the direction
- Converts as you type, entirely client side, so config files never leave your device
How to use it
- Paste TOML into the left pane, or use the direction button first if you are starting from JSON.
- Read the converted output on the right, which updates as you type.
- Click the direction button to flip between TOML to JSON and JSON to TOML; the current output becomes the new input.
- If the badge reads invalid, fix the line named in the message and the output reappears.
- Copy the result into your config file or tooling.
Tips & common mistakes
- Dates and times arrive in JSON as strings, because JSON has no date type. Converting back re-quotes them, so a full round trip turns a TOML datetime into a plain string.
- Comments are not preserved in either direction. Keep the original file when the comments matter more than the data.
- When converting JSON to TOML the top level must be an object, since a TOML document is always a table at its root. A bare array or string cannot be represented.
- JSON null has no TOML equivalent and is written as an empty string. Remove those keys, or give them real values, before converting.
- An inline table in your JSON may come back as a full table section. The data is identical, only the style differs.
- The parser covers the common surface of TOML rather than the entire specification, so treat it as a converter rather than a strict validator.
- Chaining this with the JSON to YAML converter is the quickest way to move a config between all three formats.