Developer Tools· 4 min read

TOML to JSON Converter (and JSON to TOML)

Convert config between TOML and JSON in both directions, preserving tables, arrays, and typed values.

By EasyDevTools Team Last updated: 2026-08-24

Why convert between TOML and JSON

TOML and JSON solve the same problem — structured configuration — from opposite ends. JSON is compact and universal, the lingua franca of APIs and JavaScript, but it has no comments and its punctuation-heavy syntax is hard to hand-edit. TOML was designed to be obvious to a human writing a config file, with sections, comments, and unquoted keys, which is why tools like Rust's Cargo and Python packaging adopted it.

You end up needing a converter whenever these worlds meet: pasting a TOML config into a JSON-only API, or turning a JSON blob into a TOML file a person will actually maintain.

This tool converts in both directions and preserves the type of each value — strings, numbers, booleans, dates, arrays, and nested tables — instead of flattening everything to text.

See it in action

How the two formats map

Most concepts translate one-to-one, with a few differences worth knowing:

| TOML concept | JSON equivalent |

| --- | --- |

| a table (a bracketed section) | a nested object |

| a key equals value line | a key-value pair |

| an array | an array |

| a comment | dropped (JSON has no comments) |

| a native date | a string in JSON |

The one lossy direction is TOML to JSON: comments and TOML's native date type have no JSON representation, so comments are dropped and dates become strings.

How to use the converter

Paste your TOML (or JSON) into the input panel.

Choose the direction — TOML to JSON or JSON to TOML.

The converted output appears instantly, with types preserved.

Copy the result into your config file or request body.

Checking the result

Verify types, not just text. After converting TOML to JSON, confirm that numbers came through as numbers and booleans as true/false rather than quoted strings — a common failure in naive converters that treat everything as text. Round-tripping is the strongest check: convert TOML to JSON and back, and the structure (ignoring comments) should be identical.

If a nested table did not convert as expected, check the TOML for a dotted-key or an array-of-tables section, which are the two constructs people most often mis-indent.

Common mistakes

Expecting comments to survive conversion to JSON. They cannot; JSON has no comment syntax.

Assuming a TOML date stays a date in JSON. It becomes a string, since JSON has no date type.

Mixing tabs and spaces in TOML, which is legal but makes arrays-of-tables hard to read and edit.

Quoting numbers or booleans in the source, which then convert as strings.

Where this is useful

Feeding a hand-written TOML config into an API or tool that only accepts JSON.

Turning a generated JSON config into a TOML file that a human will maintain.

Migrating a project's configuration between ecosystems that prefer different formats.

Inspecting a dense JSON blob by converting it to more readable TOML.

Frequently asked questions

Q: Are comments preserved converting TOML to JSON?

A: No. JSON has no comment syntax, so comments are dropped in that direction.


Q: What happens to TOML dates?

A: They convert to JSON strings, because JSON has no native date type.


Q: Does it preserve numbers and booleans as real types?

A: Yes. Values keep their type rather than being flattened to text.


Q: Is my config uploaded?

A: No. Conversion happens entirely in your browser.

Convert your config now

Open the TOML ↔ JSON Converter. For related formats, try the YAML ↔ JSON Converter, the JSON Formatter, or CSV to JSON.

Need help using this tool?

Read our complete TOML ↔ JSON Converter tutorial for step-by-step guidance.

Ready to try the tool?

No accounts. No uploads. No limits. Start now.