TOML to JSON Converter
Paste TOML on the left, get JSON on the right. Tables become objects, arrays of tables become arrays. Runs in your browser — no upload.
- Paste your TOML into the left textarea.
- Click "Convert to JSON". The output is a JSON object preserving table nesting.
- Copy the result, or download as data.json.
- Datetime values are converted to ISO 8601 strings; underscores in numbers are stripped.
What does it do?
Parses a TOML 1.0 document into a JSON object. Tables `[section]` become nested objects; arrays of tables `[[items]]` become JSON arrays. Strings, integers (including hex/octal/binary literals and digit-grouping underscores), floats, booleans, dates, datetimes, and times all map to JSON-equivalent representations. Inline tables and inline arrays are flattened the same way.
Example
TOML input:
name = "Ada"
active = true
[address]
city = "London" JSON output:
{
"name": "Ada",
"active": true,
"address": {
"city": "London"
}
} Common TOML errors and how to fix them
TOML has stricter rules than YAML or JSON in places. The patterns below cover most parser failures.
- Unquoted strings. `name = Ada` is invalid — bare values are interpreted as keys/booleans/numbers, not strings. Use double quotes: `name = "Ada"`.
- Mixed-type arrays (TOML 0.x). TOML 0.5 forbade mixed types in arrays; TOML 1.0 allows them. @iarna/toml follows 1.0, so `[1, "two"]` is valid here. If your TOML must round-trip through 0.5 tooling, keep arrays homogeneous.
- Re-defining a table. Defining `[a]` twice is an error. Each table header must appear at most once. Merge the keys into a single `[a]` block.
- Datetime without timezone. `d = 2026-04-26T12:00:00` (no Z or offset) is a "local datetime" — it parses, but JSON has no concept of locality. The output is the same string with the wall-clock time, not a UTC instant. Add `Z` for UTC: `d = 2026-04-26T12:00:00Z`.
- Triple-quote escape confusion. TOML basic multi-line strings use `"""..."""` and process escapes; literal multi-line strings use `\'\'\'...\'\'\'` and do not. Mixing escape rules is the most common multi-line string error.
- Inline table extension. An inline table `point = {x=1, y=2}` is closed and self-contained — you cannot later write `[point.z]` or `point.z = 3`. To extend, use the standard `[point]` block syntax instead.
Frequently asked questions
How are datetimes represented in JSON?
JSON has no native datetime type, so values become ISO 8601 strings. Offset datetimes (`2026-04-26T12:00:00Z`) and local datetimes (`2026-04-26T12:00:00`) both stringify literally — but only the offset form is unambiguous in JSON.
Are integer underscores preserved?
No — TOML allows `1_000_000` as a readability aid; the parser drops the underscores and the JSON value is `1000000`. The grouping is purely a TOML source-text feature.
What happens to TOML comments?
They are dropped. TOML comments start with `#`; JSON has no comment syntax, so the parser discards them. If you need them preserved, you would need a different intermediate format.
Are arrays of tables supported?
Yes. `[[products]]` blocks repeated multiple times become a JSON array under the `products` key. Each `[[products]]` header introduces a new array entry; subsequent key-value lines populate that entry.
Can I convert really large TOML files?
Up to about 30 MB before the textarea slows down. Very large TOML files are rare — most config files are well under 1 MB.
Is my TOML uploaded?
No. Everything runs in your browser — your data is parsed by JavaScript on this page and never sent to any server.