TOML โ‡„ JSON Converter

Convert TOML to JSON and JSON to TOML, with line-numbered error messages.

About this tool

Paste TOML to get formatted JSON, or switch direction to turn JSON into TOML. The converter validates as you type and reports errors with their line number, including duplicate keys and tables defined twice. Switching direction feeds the output back in, so you can round-trip a file. Copy the result or download it as a .json or .toml file.

TOML in brief

TOML (Tom's Obvious, Minimal Language) is the configuration format behind Cargo.toml, pyproject.toml, Hugo, Netlify and many other tools. Files are made of key = value pairs grouped under [table] headers, and [[double brackets]] add an item to an array of tables, which is how TOML expresses a list of objects. Keys can be dotted (a.b.c = 1) or quoted. Values include basic "strings" with escapes, 'literal strings', multi-line strings, integers with underscores for readability such as 8_080, hex, octal and binary integers such as 0xff, floats, booleans, dates and times, arrays and { inline tables }. Converting to JSON maps tables to objects and arrays of tables to arrays of objects. JSON has no date type, so TOML dates become ISO 8601 strings, and inf and nan become strings or null. Comments are lost in either direction. When converting JSON to TOML, objects become [tables] and arrays of objects become [[arrays of tables]]. The top level of the JSON must be an object. The YAML to JSON converter, the JSON to YAML converter and the JSON formatter handle the other config formats. What YAML is, the syntax that bites, and when JSON is the better choice compares YAML and JSON.

Frequently asked questions

What is the difference between TOML and YAML?

Both are human-friendly config formats. TOML uses explicit [tables] and key = value lines and is harder to get subtly wrong; YAML relies on indentation and has more features.

What does [[double brackets]] mean in TOML?

An array of tables: each [[name]] header adds a new object to the list called name.

Why did my TOML date become a string?

JSON has no date type, so dates and times are kept as ISO 8601 strings.

Is my file uploaded?

No. Conversion runs in your browser and nothing is stored or sent.