JSON to TOML
Converts JSON into TOML, a common format for configuration files.
Parse and convert JSON to TOML.
Steps and notes
What is JSON to TOML?
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.
- Paste the JSON
- Get the TOML result
- Copy and use it
Frequently asked questions
- 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.
Category: Converter
JSON format conversion workflow
JSON to YAML converter → YAML to JSON converter → JSON to XML → XML to JSON → JSON to TOML → TOML to JSON