JSON to TOML Converter
Convert JSON objects to TOML format with type preservation and clean table structure output.
JSON to TOML Converter tool
Example
Input: {"title":"App","server":{"host":"localhost","port":8080}}
Result: title = "App" / (blank line) / [server] / host = "localhost" / port = 8080
Top-level values become key = value lines and each nested object becomes a [table] section. Strings are quoted and numbers keep their type.
How JSON Maps to TOML
| JSON | TOML |
|---|---|
| {"a":"x"} | a = "x" |
| {"n":8080} | n = 8080 |
| {"f":1.0} | f = 1 |
| {"b":true} | b = true |
| {"arr":[1,2]} | arr = [ 1, 2 ] |
| {"s":{"k":1}} | [s] then k = 1 |
| {"s":{"t":{"k":1}}} | [s.t] then k = 1 |
| {"items":[{"n":1},{"n":2}]} | [[items]] n = 1, then [[items]] n = 2 |
| {"x":null,"y":1} | y = 1 (x is dropped) |
| {"first name":"A"} | "first name" = "A" |
Output of this converter; "then" marks a new line.
- Paste your JSON object into the input area on the left side.
- The converter validates the JSON and maps nested objects to TOML table sections automatically.
- Review the generated TOML output with proper [table.headers] and key-value pairs in the right panel.
- Check that arrays of objects are correctly represented using [[double.bracket]] syntax.
- Click the copy button to copy the TOML output for use in your Cargo.toml, pyproject.toml, or other config file.
JSON to TOML: Tables, Arrays and Types
This converter rewrites a JSON object as TOML, the config format behind Cargo.toml in Rust and pyproject.toml in Python. Top-level values become key = value lines, and each nested object becomes a [table] section.
TOML (Tom's Obvious, Minimal Language) looks like an INI file with real data types. Strings are always quoted, while numbers and booleans are not. Nesting is shown with section headers instead of indentation, so {"server":{"tls":{"on":true}}} becomes a [server.tls] header followed by on = true. An array of objects becomes an array of tables, with one [[items]] header per entry.
Some JSON has no TOML form, so watch for a few things. The root must be an object; a top-level array or a plain value gives an error. TOML has no null, so keys whose value is null are left out, and an array that contains null cannot be converted at all. Whole-number floats such as 1.0 are written as 1, which TOML reads as an integer. Keys with spaces or other special characters are quoted, as in "first name" = "A".
Plain values are always written before any [table] section, because in TOML every key after a header belongs to that table. The panels work both ways, so you can paste TOML on the right to get JSON back. To move config straight between TOML and YAML, use the TOML to YAML Converter.
Sources
Frequently Asked Questions
Related Tools
TOML to JSON Converter
Parse TOML documents and convert to formatted JSON output with validation and error reporting.
Developer ToolsJSON Formatter and Validator
Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.
Developer ToolsJSON to YAML Converter
Convert JSON documents to YAML format with syntax validation, clean formatting, and instant preview.
Developer ToolsTOML to YAML Converter
Convert TOML configuration files to YAML format seamlessly with structure preservation.
Developer Tools