From JSON’s braces to TOML’s tables
TOML reads like an ini file that grew up. It’s what Rust’s Cargo, Python’s pyproject, and a pile of CLI tools use for config, because it’s easy for a human to scan. But most data starts life as JSON, from an API, a package.json, or a quick object you typed out. This converter bridges the two.
Paste your JSON on the left. TOML shows up on the right as you type. No button to press, no file to upload, the whole thing runs in your browser.
What it does with each shape
JSON and TOML don’t map one-to-one, so here’s how the pieces translate:
- Plain values (strings, numbers, booleans) become
key = valuelines. - Nested objects turn into
[table]headers, with dotted paths for deeper nesting like[server.tls]. - Arrays of objects become arrays of tables, the
[[plugins]]double-bracket form TOML uses for repeated sections. - Arrays of plain values stay inline:
keywords = ["cli", "tool", "fast"]. - Objects buried inside an array render as inline tables with curly braces.
Strings get escaped properly, so a path with backslashes or a value with quotes won’t break the output. Keys that aren’t plain identifiers get quoted automatically.
A real example
Feed it a config like an app with a server block, a database block, and a list of plugins, and you get back something a TOML parser will read without complaint: scalars first, then [server], then [server.tls] nested under it, then a pair of [[plugins]] entries. The ordering isn’t cosmetic, TOML wants top-level keys before their sub-tables, and the converter handles that for you.
The one thing to watch
TOML has no null. JSON does. When a key’s value is null, there’s simply nowhere to put it in TOML, so the converter drops that key rather than invent a fake empty value. If your data leans on nulls to mean something, you’ll want to clean those up before or after converting.
Same goes for the top level: TOML always starts as a table, so the root of your JSON has to be an object. A bare array or a lone string at the top has no valid TOML representation, and you’ll get a clear message instead of broken output.
Questions people ask
Is my JSON sent anywhere?
No. The conversion happens entirely in your browser with JavaScript. Nothing is uploaded, logged, or stored, which makes it safe for config that holds secrets or internal hostnames.
Why did my null values disappear?
Because TOML has no concept of null. There’s no syntax for “this key exists but has no value,” so those keys are skipped. It’s a limitation of the format, not a bug in the conversion.
What’s the difference between a table and an array of tables?
A single nested object becomes one [table]. A list of objects becomes repeated [[array.of.tables]] blocks, one per item. The converter picks the right form based on whether your JSON value is an object or an array of objects.
Can it handle deeply nested config?
Yes. Nesting becomes dotted table paths, so an object three levels deep ends up as [a.b.c]. There’s no practical depth limit for normal config files.
Do I need to format the JSON first?
No. Minified or pretty-printed, it parses the same. As long as it’s valid JSON, the TOML comes out clean and readable.