JSON to TOML — Guide
Parse and convert JSON to TOML.
What it is and when to use it
TOML (Tom's Obvious Minimal Language) was designed as a readable config format that maps cleanly onto a hash table — and, crucially, onto JSON as well. This tool walks a JSON value and emits the equivalent TOML: objects become tables, nested objects become dotted keys or sub-tables, and arrays become TOML arrays. The reverse direction is handled by the TOML-to-JSON tool, so you can move between the two formats without hand-editing. This is the bridge most teams need when a project's config started as JSON but the surrounding tooling (Cargo, pyproject.toml, Hugo) expects TOML.
Converts JSON into TOML, a common format for configuration files.
How to use it
- Paste the JSON
- Get the TOML result
- Copy and use it
A worked example
Fill in sample JSON
{ "title": "demo", "server": { "port": 8080 } }Copy this into the tool, or open JSON to TOML
Questions people ask
- Do JSON and TOML represent the same data?
- Mostly. TOML was deliberately designed so a TOML document maps onto a JSON object, and JSON is a subset of what TOML can express. The conversion is lossless for the common cases: strings, numbers, booleans, arrays and nested tables.
- How are nested JSON objects written in TOML?
- A nested object becomes either a [table] section or a dotted key. { "server": { "port": 8080 } } can be written as [server] followed by port = 8080, or as server.port = 8080 — both are valid TOML. This tool uses dotted keys for shallow nesting and full tables for deeper structures.
- What is lost when converting?
- Nothing in the data model, but TOML has stricter key rules than JSON: keys holding certain characters must be quoted, and duplicate keys across tables are an error. JSON allows arbitrary string keys, so if yours contain dots or square brackets, expect them to be quoted in the TOML output.
Next steps
Spotted something wrong on this page? Tell us via Contact Us