JSON to TOML

Parse and convert JSON to TOML.

About JSON to TOML

Converts JSON into TOML, the configuration format used by Cargo (Rust), pyproject.toml (Python), Hugo and many CLI tools. Objects become tables, arrays of objects become arrays of tables.

When you would use it

How to use it

  1. Paste JSON (JSON5 syntax is accepted) into the left field.
  2. Read the TOML on the right.
  3. Copy the result.

Things worth knowing

Frequently asked questions

Why does the conversion fail on valid JSON?
TOML is stricter than JSON: the document must be an object and null does not exist. A top-level array or scalar gives no output, and null keys silently disappear.
Where did my key with a null value go?
It was dropped, because TOML cannot express null. Use an empty string, a sentinel value, or simply omit the key in the consuming program.

All the tools