JSON to TOML — Converter for Cargo.toml, pyproject.toml and TOML 1.0 Configs
Serialize JSON key-values and nested tables into valid TOML v1.0 syntax.
- TOML writes plain values before [tables], so some keys move compared with the JSON; the data is the same.
- Nested objects become [tables], arrays of objects become [[arrays of tables]] and multi-line text uses """…""". In testing, Python's tomllib reads the output back and it must equal the JSON data.
When to use the JSON to TOML (Cargo.toml / pyproject.toml) Converter
Tables and arrays of tables
Nested objects become [tables], arrays of objects become [[arrays of tables]] and other arrays are written inline. Parent tables with no values of their own get no header.
Order that follows TOML rules
TOML requires plain values before sub-tables, so some keys may move. The data stays the same, and a note appears when the order changes.
Safe strings and numbers
Keys that are not bare keys are quoted, multi-line text uses triple quotes, control characters are escaped, and JSON numbers are copied as they are because their form is already valid TOML.
Tested with tomllib
Every output is read back by Python's tomllib and must equal the original JSON data, integers and floats included.
Frequently asked questions
Why are big integers rejected?
TOML 1.0 limits integers to the 64-bit range, from −2^63 to 2^63−1. Store larger numbers as strings.
What about keys with dots or spaces?
Keys such as "a.b" or "server name" are quoted so they are not read as dotted keys. Keys made only of letters, digits, underscores and hyphens stay unquoted.
Are dates written as TOML datetimes?
No. JSON has no date type, so date text stays a quoted string and the data type does not change.
What about mixed arrays?
TOML 1.0 allows arrays of mixed types; objects inside them are written as { … } inline tables.
Is my data uploaded?
No. The conversion runs in your browser.
Similar tools
- TOML v1.0 to Formatted JSON ConverterParse [table] TOML configuration files into clean structured JSON.
- JSON Formatter & Syntax PrettifierFormat messy single-line JSON with 2/4-space indentation and sorted keys.
- JSON Minifier & Whitespace CompressorStrip whitespace and newlines from JSON payloads and compare byte savings.
- RFC 8259 JSON Syntax Validator & DebuggerPinpoint trailing commas, unquoted keys & syntax errors with line/column clues.