JSON to TOML Converter
Paste JSON and get the equivalent TOML — nested objects become `[table.headers]`, arrays of objects become `[[array of tables]]`, and keys are quoted when needed.
Last updated: May 27, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON to TOML Converter?
TOML (Tom's Obvious Minimal Language) is a configuration format designed to be unambiguous and easy to read. It is the canonical config format for Cargo (Rust), Poetry (Python), and many other tools. The interesting parts of TOML are its table headers — `[server.database]` — and its array of tables syntax — `[[products]]` — which let you express nested structures without indentation.
Converting from JSON is straightforward in principle but requires care for nested arrays of objects. This tool walks the JSON tree, emitting scalar fields first, then nested tables, then arrays of tables. Keys that contain characters outside the bare-key set (`[A-Za-z0-9_-]`) are automatically quoted.
How to Use JSON to TOML Converter
Paste a JSON object into the input panel (root must be an object).
Optionally enable alphabetical key sorting for canonical output.
Copy the generated TOML and use it in your config file.
Common Use Cases
- Migrating a JSON config file to a TOML-based tool (Cargo, Poetry, Hugo).
- Generating TOML config samples from a JSON schema example.
- Producing a readable TOML view of a JSON document for documentation.
- Round-tripping between JSON and TOML representations.
Example Input and Output
A nested JSON object becomes TOML with table headers.
{ "title": "Example", "server": { "host": "localhost", "port": 8080 } }title = "Example"
[server]
host = "localhost"
port = 8080Privacy
All conversion happens in your browser. No JSON is sent to a server.
Mixed-type arrays
TOML 1.0 allows arrays containing different value types (e.g. [1, "two", true]). This tool emits them as TOML inline arrays. If your consumer requires homogeneous arrays, validate the JSON before conversion.

