About the JSON to TOML Converter tool
Configuration often starts life as JSON, generated by a script, exported from an admin panel or copied from documentation, while the tool you are configuring expects TOML. Rewriting it by hand means deciding where every [table] header goes and getting the quoting right. This converter does that mapping for you.
Top-level values are written first as key = value lines. Nested objects become [section] tables, deeper objects become [section.sub] headers, and arrays whose items are all objects become [[arrays of tables]], which is how TOML represents lists of records such as menu items or build targets. Mixed arrays and objects inside arrays are written inline. Keys that contain spaces, dots or other special characters are quoted, strings are escaped properly, and strings that contain line breaks can be written as readable """multi-line""" strings.
TOML has no null, so you choose what happens to null values: leave the key out, or write an empty string. The top level must be a JSON object, because a TOML document is always a table. The output can be copied or downloaded as a .toml file, and all conversion happens in your browser.
How to use JSON to TOML Converter
- Paste a JSON object into “JSON input”, or click “Load sample”.
- Choose how to handle “null values” and whether to write “Multi-line strings as """…"""”.
- Check the “TOML output” for the generated tables.
- Click “Copy” or “Download” to save the .toml file.
Features
Tables and arrays of tables
Nested objects become [tables] and lists of objects become [[arrays of tables]].
Correct quoting
Special keys are quoted and string values are escaped following TOML rules.
Null handling
Choose to omit nulls or write them as empty strings, since TOML has no null.
Readable multi-line text
Long text with line breaks can use TOML’s triple-quoted strings.
When to use it
- Turn a JSON config into a Hugo or Netlify TOML file.
- Create a pyproject.toml or Cargo.toml section from JSON data.
- Migrate an app’s settings file from JSON to TOML.
- Generate TOML fixtures for a test suite from existing JSON.
Frequently asked questions
Why must the JSON be an object?
A TOML document is always a table of key/value pairs. A top-level JSON array or single value has no TOML equivalent, so wrap it in an object with a key.
How are nulls converted?
TOML has no null type. By default keys with null values are left out; you can instead write them as empty strings. A null inside an array needs the empty-string option.
Are date strings turned into TOML dates?
No. They stay quoted strings, because a JSON string that looks like a date may not be meant as one. Remove the quotes by hand if you want a native TOML date.
Is the output valid TOML?
Yes. The serializer follows TOML 1.0, and you can paste the result into the TOML to JSON converter on this site to check that it round-trips.