About the JSON to TOML
Convert JSON objects to TOML. Nested objects become [tables] and arrays of objects become [[arrays of tables]].
Key features
- Converts JSON objects to valid TOML 1.0
- Nested objects become [tables]
- Arrays of objects become [[arrays of tables]]
- Null values are omitted (TOML has no null)
- Keys quoted automatically when needed
- Download as config.toml
Convert JSON to TOML
TOML is a favourite for configuration files because it's easy to read and has comments, unlike JSON. If you're moving a project's settings into pyproject.toml, Cargo.toml, a Hugo site config or a CLI tool's config file, this converter turns JSON into clean, valid TOML.
Example
{
"title": "Example",
"owner": { "name": "Ada", "dob": "1815-12-10" },
"database": { "ports": [8000, 8001], "enabled": true },
"servers": [
{ "name": "alpha", "ip": "10.0.0.1" },
{ "name": "beta", "ip": "10.0.0.2" }
]
}
title = "Example"
[owner]
name = "Ada"
dob = "1815-12-10"
[database]
ports = [ 8000, 8001 ]
enabled = true
[[servers]]
name = "alpha"
ip = "10.0.0.1"
[[servers]]
name = "beta"
ip = "10.0.0.2"
JSON vs. TOML for configuration
| JSON | TOML | |
|---|---|---|
| Comments | ❌ | ✅ |
| Trailing commas | ❌ | ✅ in arrays |
| Native dates | ❌ | ✅ |
| Deep nesting | ✅ easy | ⚠️ gets verbose |
| Null | ✅ | ❌ |
| Typical use | APIs, data | App/tool configuration |
Limitations to know
- Root must be an object. Arrays or plain values at the top level can't be TOML documents.
- No null. Keys with
nullvalues are dropped. - Deeply nested data produces long dotted table headers; consider YAML for very deep structures.
Related tools
Convert TOML back with TOML to JSON and check files with the TOML Validator. Prefer YAML? Use JSON to YAML.
How to use the JSON to TOML
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The TOML appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.