JSON to TOML Converter
Convert JSON to TOML - objects become tables, arrays of objects become arrays of tables, with correct TOML value formatting.
Paste JSON below - this tool converts it into TOML syntax, with nested objects becoming tables and correctly-formatted values.
More File & Data Conversion Tools
View all 20For the reverse direction, see the TOML to JSON Converter.
How the Conversion Works
Top-level primitive keys become plain key = value lines; nested objects become [table] sections; arrays containing only objects become [[array of tables]]; other arrays become inline TOML arrays.
How to Use It
- Paste a JSON object.
- Click Convert.
- Copy or download the resulting TOML.
Limitations
JSON's null has no direct TOML equivalent (TOML has no null type) - keys with a null value are omitted from the TOML output rather than producing invalid syntax, and this is noted so you're aware of the difference.
Example
{
"name": "invoice-kit",
"version": "1.4.0",
"database": { "host": "db.internal", "port": 5432 },
"servers": [ { "name": "alpha" }, { "name": "beta" } ]
}
becomes:
name = "invoice-kit"
version = "1.4.0"
[database]
host = "db.internal"
port = 5432
[[servers]]
name = "alpha"
[[servers]]
name = "beta"
Where TOML Is Used
- Python:
pyproject.tomlfor packaging and tool settings (Black, Ruff, pytest, Poetry). - Rust:
Cargo.tomlfor every crate. - Static sites and apps: Hugo, Netlify (
netlify.toml) and many CLI tools.
Tips
- Keys with spaces or dots are quoted in TOML (
"my key" = 1) - simple keys keep the file readable. - TOML has no
null; leave the key out or use an empty string. - Comments are not part of JSON, so add them to the TOML file afterwards to explain important settings.
Convert back with TOML to JSON. Choosing a format? See JSON vs YAML vs TOML vs XML.
Frequently Asked Questions
Explore More Tools
Keep going with related categories and our most used tools.