TOML ⇄ JSON Converter
Converters & FormattersConvert TOML to JSON and back. Tables, array-of-tables, and dotted keys round-trip; bare TOML dates stay date-only, datetimes become ISO-8601 strings. Swap carries the result into the input.
What it does
Converts TOML to JSON and JSON to TOML in one place. The TOML direction handles tables, array-of-tables ([[x]]), inline tables, and dotted keys, emitting pretty 2-space JSON; the JSON direction emits idiomatic TOML with nested [tables] and [[array-of-tables]] syntax. Swap flips direction and carries the result into the input for instant round-trips. Invalid input shows the parser’s error message. Everything runs locally in your browser.
How to use it
- Paste TOML (or JSON) into the input on the left — the header badge shows the current direction.
- The conversion appears live on the right. Copy takes it; Download saves
converted.jsonorconverted.toml. - Swap exchanges sides and moves the output into the input.
- Copy share link encodes your input and direction in the URL.
Examples
Tap Sample (TOML direction):
[server] with host/port plus a [[peers]] array-of-tables → a JSON object whose peers key holds an array of objects.
The Cargo-style chip converts a Cargo.toml-shaped document — [package] and [dependencies] become nested JSON objects.
In the JSON direction, {"items":[{"n":1},{"n":2}]} becomes [[items]] blocks — one per element, keys inside.
Good to know
- Bare TOML dates (
2024-01-15) stay date-only strings in JSON; datetimes (2024-01-15T10:30:00Z) become full ISO-8601 strings with milliseconds. - Mixed-type arrays (
[1, "two", true]) keep their order and types in JSON. - Numbers keep their TOML representations where possible; floats and integers stay distinct.
- TOML has no
null— JSONnullvalues need removing before converting to TOML.