Why TOML for configuration
TOML was designed to be an obvious, minimal config format: key = value pairs, [sections] for groups and comments with #. Rust's Cargo, Python's pyproject.toml, Hugo, Netlify and many other tools use it.
This converter maps JSON objects to TOML tables and arrays of objects to array tables, keeps your key order and writes values with correct quoting. Because TOML has no null, null values are left out rather than producing an invalid file.
JSON vs TOML at a glance
| Feature | JSON | TOML |
|---|---|---|
| Full name | JavaScript Object Notation | Tom's Obvious, Minimal Language |
| Type | Hierarchical data | Configuration data |
| Introduced | Early 2000s (RFC 4627 in 2006) | 2013 |
| Created by | Douglas Crockford; now ECMA-404 and RFC 8259 | Tom Preston-Werner |
| Structure | Nested objects and arrays | Key/value pairs grouped into [tables] |
| Comments | No | Yes, with # |
| Data types | String, number, boolean, null, object, array | String, integer, float, boolean, date-time, array, table; no null |
| Best for | APIs, web apps and app settings | Project config such as Cargo.toml and pyproject.toml |
| Support | Every programming language | Rust, Python, Go and most languages via libraries |
| MIME type | application/json | application/toml |
How to convert JSON to TOML
Step 1: Select a JSON file
Drop the .json config or data file onto the converter.
Step 2: TOML is preselected
Leave TOML as the output.
Step 3: Convert
Objects become tables, arrays become TOML arrays, and nulls are removed.
Step 4: Download the .toml file
Add comments and drop it into your project.
How JSON maps to TOML
Tables
Nested objects become [section] and [section.sub] tables.
Array tables
Arrays of objects become [[section]] blocks.
Null handling
Null values are removed because TOML cannot represent them.
Top-level arrays
A JSON array is wrapped under an items key, since TOML needs a table at the root.
Where JSON to TOML is handy
Rust projects. Draft Cargo.toml sections from JSON data.
Python packaging. Move settings into pyproject.toml.
Static site generators. Hugo and Zola read TOML configuration.
Readable app settings. Give users a config file with comments.
Things TOML cannot express
TOML has no null value, so keys with null are dropped. Arrays in TOML 1.0 may mix types, but some older parsers reject mixed arrays, so keep arrays uniform if your tool is strict.
JSON has no date type, so dates in your JSON are written as quoted strings. If your tool expects real TOML dates, remove the quotes around them after converting.
- "timeout": null is removed.
- "started": "2026-09-17" stays a quoted string.
- [1, 2, 3] stays an inline array.
Reading the output
Simple values at the top level appear first, followed by tables. Nested objects are written as dotted table headers such as [server.tls], which is standard TOML.
Keys that contain spaces, dots or other special characters are quoted so the file parses correctly.
Tips for JSON to TOML
- Replace null values with sensible defaults before converting if the keys must exist.
- Check the output with the tool that will read it; each tool has its own expected keys.
- Add comments above tables to explain settings.
- Use TOML to JSON to verify the round trip.
JSON to TOML questions
What happens to null values?
They are removed, because TOML has no null type.
Can the JSON root be an array?
Yes. It is wrapped under an items key, because a TOML document must be a table.
How are arrays of objects written?
As array tables using double brackets, like [[items]].
Is key order preserved?
Yes, within the rules of TOML, where simple values come before tables.
Which TOML version is produced?
TOML 1.0, written with the smol-toml library.
Is my file uploaded?
No. The conversion happens in your browser.