How to use the JSON to TOML
- Paste a JSON object (TOML documents must be a table at the root).
- Fix anything reported as unsupported, most often null values.
- Review the output: simple values come first, then tables, as TOML requires.
- Copy it into Cargo.toml, pyproject.toml, config.toml or wherever it belongs.
Worked example
A site config with a nested table and a list of servers
Input
{"title":"site","port":8080,"owner":{"name":"Ada"},"servers":[{"host":"a","weight":1},{"host":"b","weight":2}]}TOML
title = "site" port = 8080 [owner] name = "Ada" [[servers]] host = "a" weight = 1 [[servers]] host = "b" weight = 2
Plain keys must come before any [table] header, because every key after a header belongs to that table.
TOML limits compared with JSON
| JSON allows | TOML | What to do |
|---|---|---|
| null | No null type | Remove the key or use an empty string / sentinel |
| Array at the root | Root must be a table | Wrap it: {"items": [...]} |
| Integers of any size | Signed 64-bit only | Store larger values as strings |
| Any key string | Bare keys A–Z a–z 0–9 _ -; others quoted | Converter quotes keys automatically |
| Numbers like 1e400 | Must fit a 64-bit float | Store as a string |
Inline tables vs. sections
TOML offers two ways to write a nested object: a [section] header, or an inline table on one line, such as owner = { name = "Ada" }. Sections are easier to read for anything with more than two or three keys; inline tables suit small values inside arrays. In TOML 1.0 inline tables must fit on one line and cannot be extended later.
Dates and typed values
TOML has native date-time types (2026-10-29T08:00:00Z without quotes). JSON stores dates as strings, so the converter writes them as quoted strings to preserve the original type. Remove the quotes by hand if the consuming program expects a real TOML date.
JSON to TOML FAQ
Does TOML support null?
No. TOML has no null value. Omit the key, which most programs treat as "not set", or pick an explicit placeholder that the program understands.
What is [[double bracket]] syntax in TOML?
It declares an array of tables. Each [[servers]] header starts a new object appended to the servers array, matching a JSON array of objects.
Can TOML arrays mix types?
Since TOML 1.0.0, yes: [1, "two", 3.0] is valid. Older parsers built for v0.5 may reject it.
Why must my JSON be an object to convert to TOML?
A TOML document is always a table of key/value pairs. A top-level array or bare value has no TOML representation, so wrap it in an object with a key.
Is TOML or YAML better for config files?
TOML is explicit and hard to mis-indent, which is why Rust (Cargo) and Python (pyproject.toml) chose it. YAML is more compact for deeply nested data. Both are fine; follow your tool's convention.

