Paste TOML and get formatted JSON as you type.
Paste TOML, upload a .toml file or drop one here.
Updates as you type. Copy it or download a .json file.
Converting…
This free TOML to JSON converter reads any TOML document and writes it out as formatted JSON. Paste a Cargo.toml, a pyproject.toml or a Hugo or Netlify config, and the JSON version appears as you type, with every table, array of tables, string and number mapped to its JSON equivalent. There is nothing to install and no sign-up, and because the TOML to JSON conversion runs in your browser, your file is never uploaded.
TOML is a pleasant format to write by hand, but scripts, APIs, JSON Schema validators and most front-end tooling want JSON. This tool bridges the two, and it is strict about it: invalid TOML is reported with its line and column instead of being half-converted.
.toml file. You can also drag a file onto the editor.Invalid TOML at line 2, column 5.data.json.Tables become nested objects, each [[bin]] block becomes one item in an array, and an inline table such as { version = "4.5", ... } becomes an ordinary object. Keys stay in the order they appear in the TOML.
[package]
name = "orders-cli"
version = "0.4.2"
authors = ["Ada Lovelace <ada@example.com>"]
[dependencies]
clap = { version = "4.5", features = ["derive"] }
[[bin]]
name = "orders"
path = "src/main.rs"
[[bin]]
name = "orders-admin"
path = "src/admin.rs"{
"package": {
"name": "orders-cli",
"version": "0.4.2",
"authors": [
"Ada Lovelace <ada@example.com>"
]
},
"dependencies": {
"clap": {
"version": "4.5",
"features": [
"derive"
]
}
},
"bin": [
{
"name": "orders",
"path": "src/main.rs"
},
{
"name": "orders-admin",
"path": "src/admin.rs"
}
]
}| TOML | JSON output | Notes |
|---|---|---|
[table] | Object | Dotted keys such as a.b = 1 become nested objects too. |
[[array of tables]] | Array of objects | One object per [[ ]] block, in document order. |
| Array | Array | Items may be of mixed types. |
| String (4 kinds) | String | Basic, literal and both multi-line forms. Escapes are resolved. |
| Integer | Number | Hex, octal, binary and 1_000 become plain decimal numbers. |
| Float | Number | 1.0 becomes 1; inf and nan become strings. |
| Boolean | true / false | Unchanged. |
| Date and time | String | See the next section. |
| Comment | Dropped | JSON has no comments. |
TOML has four date and time types and JSON has none, so each one is written as a string that keeps its TOML form. An offset datetime keeps the offset you wrote, and the three local types stay local: the converter never invents a time zone. Milliseconds are shown only when they are not zero, and fractional seconds beyond milliseconds are dropped.
published = 2026-03-14T09:30:00Z start = 2026-03-14T09:30:00 day = 2026-03-14 alarm = 07:30:00 id = 9223372036854775807 ratio = inf
{
"published": "2026-03-14T09:30:00Z",
"start": "2026-03-14T09:30:00",
"day": "2026-03-14",
"alarm": "07:30:00",
"id": 9223372036854775807,
"ratio": "inf"
}TOML integers can be 64-bit, but JavaScript numbers are only exact up to 9007199254740991. The converter writes larger integers with all their digits, as in the id above, which is valid JSON and is read correctly by Python, Go, Java and most other languages. JavaScript's JSON.parse would round it, so tick Large integers as strings to get "9223372036854775807" instead. Only integers beyond the safe range are quoted.
TOML allows inf, -inf and nan as float values, but JSON has no way to write them, and JSON.stringify would silently turn them into null. This converter keeps the information instead and writes the strings "inf", "-inf" and "nan".
Comments cannot survive in JSON, so they are removed. The order of keys is preserved, and TOML has no null, so the JSON you get never contains one.
TOML is stricter than it looks, and the converter stops at the first mistake instead of guessing. The message in the status bar gives the line and column, so you can jump straight to it. The mistakes below account for most failures:
name = demo is rejected with invalid value. Strings need quotes: name = "demo".[table] a second time, gives trying to redefine an already defined table or value.{"a": 1} fails on line 1. Use the JSON to TOML converter for that direction.Wondering which format to pick? Our comparison of YAML vs JSON covers the trade-offs, and the same ones apply in the TOML vs JSON decision: TOML is easier to edit, JSON is easier to exchange. To go the other way, use the JSON to TOML converter. Related tools include the YAML to JSON converter and the JSON to YAML converter. Need test data? Create some with the JSON Generator, or describe the converted result with the JSON Schema Generator.
TOML reads like an INI file with real data types: comments, multi-line strings, native dates and tables you can split across the document. JSON has fewer features but is the common language of web APIs, databases and front-end tooling. Teams usually keep TOML for the files people edit and convert to JSON for anything a program consumes.
Paste your TOML into the TOML Input editor, or upload a .toml file. The JSON appears in the output editor as you type. Copy it, or click Download to save it as data.json.
TOML is designed for configuration files that people edit by hand: it allows comments, multi-line strings and native date and time values. JSON is a stricter data-exchange format with no comments and no date type, but it has null and is understood by every language and API.
JSON has no date type, so each TOML date and time becomes a string in its own form: "1979-05-27T07:32:00Z" for an offset datetime, "1979-05-27T07:32:00" for a local datetime, "1979-05-27" for a local date and "07:32:00" for a local time. Offsets are kept as written and nothing is shifted to another time zone.
By default every digit is kept, so 9223372036854775807 is written as that exact number. JavaScript's JSON.parse rounds integers above 9007199254740991, though, so tick Large integers as strings if the JSON will be read in a browser or Node.js.
JSON cannot represent infinity or not-a-number, so inf and +inf become the string "inf", -inf becomes "-inf", and nan, +nan and -nan all become "nan". Convert them back in your own code if you need the numeric values.
No. JSON has no comments, so lines starting with # and trailing comments are dropped. Everything else, including the order of your keys, is kept.
No. The conversion runs entirely in your browser with JavaScript, so your TOML never leaves your device. That makes it safe for config files that contain internal hostnames, registry URLs or other private values.