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.
Frequently Asked Questions
Why must the root be a JSON object?
TOML documents are always tables (key/value collections) at the root. A JSON array or primitive has no equivalent root form in TOML.
How are null values handled?
TOML has no null type. This tool silently drops null fields. To represent absence explicitly, omit the key from the JSON before conversion.
What about dates?
JSON has no date type. ISO-8601 strings in your JSON will be emitted as TOML strings; to get TOML date-time literals, post-process the output manually.
Does this send my JSON anywhere?
No. All conversion happens locally in your browser.
Related Tools
TOML Validator
Validate TOML 1.0 input and view the parsed structure as JSON. Reports the line number of the first syntax error with a clear message.
JSON Formatter
Format, validate, and beautify JSON instantly — with clear error messages, Tree View, Diff mode, and Schema validation.
YAML to JSON Converter
Convert YAML to JSON and JSON to YAML — for config files, CI pipelines, and Kubernetes manifests.
JSON to XML Converter
Convert JSON to XML online. Nested objects and arrays are mapped to XML elements with configurable root element name and optional XML declaration.
JSON Validator
Validate JSON syntax online. Shows valid/invalid status, error location (line and column), and structure stats including type, key count, and depth.
JSON Fixer
Fix broken or invalid JSON automatically. Repairs trailing commas, single quotes, bare keys, Python literals, and JavaScript comments.

