JSON to TOML Converter
Convert a JSON object into TOML with nested tables, arrays of tables, and your choice of indentation, all in your browser.
Converted to TOML live as you type. Nothing leaves your browser.
Indentation
Options
How to convert JSON to TOML online
Paste your JSON
Paste or type a JSON object into the input, and conversion to TOML runs the moment there is valid JSON.
Choose the formatting
Set the indentation, sort keys alphabetically, and decide whether small objects collapse into inline tables.
Review the TOML
Nested objects become table headers, arrays of objects become arrays of tables, and dates and numbers are written to TOML rules.
Copy or download
Copy the TOML to your clipboard or download it as a .toml file.
Why use this tool
Tables and arrays of tables
Nested objects become [table] and [nested.table] headers, and arrays of objects become [[array of tables]] blocks, emitted in the order TOML requires.
Correct value formatting
Strings are quoted and escaped, numbers become integers or floats, booleans stay booleans, and keys with dots, spaces, or symbols are quoted automatically.
Date detection
Strings that match ISO 8601 date and time formats are written as native TOML dates and times, and this can be turned off when you want plain strings.
Inline small tables
Optionally collapse small objects whose values are all scalars onto one line as inline tables, or keep every object as its own section.
Clear errors, not crashes
Invalid JSON, a non-object at the top level, or a mixed-type array shows a plain message that explains how to fix it.
Runs entirely in your browser
Everything happens on your device. Nothing is uploaded, stored, or logged.
About this tool
This converter turns a JSON object into TOML entirely in your browser. Top level values are written first, nested objects become table headers like [server] and [server.tls], and arrays of objects become repeated [[array of tables]] blocks. Keys are quoted only when they contain characters that a bare TOML key cannot hold, so the output stays as clean as the input allows. The conversion runs as you type, with no button to press.
Reach for it when a service, script, or build tool speaks JSON but a config file wants TOML, or when you are moving settings between formats. It pairs well with the JSON formatter for validating and tidying the input first, and with JSON to YAML when the destination expects YAML instead. Indentation, alphabetical key sorting, and inline tables for small objects are all adjustable, and the result updates the moment the JSON changes.
TOML has no null value, so keys set to null are dropped, and an array that mixes types is reported as an error rather than written as invalid TOML. A TOML document must be a table, so a top level array or a bare number is refused with a note on how to wrap it. Strings that match ISO 8601 date and time formats are written as native TOML dates unless you turn that behaviour off.
Frequently asked questions
- How does the JSON to TOML conversion work?
- Paste a JSON object and the TOML appears instantly. Top level scalars are written first, nested objects become [table] and [nested.table] headers, and arrays of objects become [[array of tables]] blocks in the correct order.
- Is my data uploaded anywhere?
- No. The conversion runs entirely in your browser. Your data never leaves your device, is never sent to a server, and is not stored or logged.
- How are dates, numbers, and strings handled?
- Numbers become TOML integers or floats, booleans stay true or false, and strings are quoted and escaped. Strings that match ISO 8601 date and time formats are written as native TOML dates, which you can disable to keep them as plain strings.
- What happens with null values and mixed-type arrays?
- TOML has no null, so any key whose value is null is dropped from the output. An array that mixes types, such as a string next to a number, is reported as an error because TOML cannot represent it.
- Why will my top level JSON array not convert?
- A TOML document must be a table, so it cannot start with an array or a bare value. Wrap your array in an object with a key, for example { "items": [ ... ] }, and it will convert.
- Can I control indentation and key order?
- Yes. Choose no indentation for canonical flat TOML, or 2 or 4 spaces to indent nested tables. You can also sort keys alphabetically and collapse small objects into inline tables.
Related tools
JSON to YAML
Convert JSON to YAML and YAML back to JSON, in both directions, with your choice of indentation.
JSON Formatter & Validator
Pretty-print, minify, or explore JSON as a collapsible tree, with syntax errors shown inline.
YAML to JSON
Paste YAML and get JSON instantly, indented or minified, with parse errors that point at the line.
Angle Converter
Convert an angle between degrees, radians, gradians, turns, arcminutes and arcseconds, with a degrees-minutes-seconds breakdown.
Area Converter
Convert area between metric and imperial units instantly.
Binary to Decimal Converter
Convert a binary number to its decimal value, with hexadecimal and octal readouts.