JSON1

JSON1 / JSON to TOML

JSON to TOML

Convert JSON to TOML. Nested objects become tables, arrays of objects become table arrays, and everything else inlines.

Processed locally
InputJSON
Ready
OutputTOML

Converted output appears here as you type.

Good to know

  • TOML documents must have an object at the top level, so a JSON array cannot convert directly.

About this tool

TOML is the configuration format used by Cargo, pyproject, and a growing number of tools. It aims to be unambiguous where YAML is subtle: types are explicit, and there is no significant whitespace.

Nested objects become [table] headers, arrays of objects become [[table]] array-of-table blocks, and everything else is written inline. Key order is preserved, so the output stays diffable.

Why is a top-level array rejected?
A TOML document is a table — a set of key/value pairs — so there is nowhere for a bare array to live. Wrap it in an object under a key first.
Do I get comments?
No, because there are none in the JSON to carry over. TOML supports # comments, so this is a good place to add them once the file is generated.