TOML to JSON
Convert TOML to JSON live — configurable indentation and key stats, with a clear error for malformed input.
About this ToolHow it works, benefits & use casesTap to collapse
TOML to JSON parses a TOML configuration document and emits the equivalent JSON. Paste TOML — including [table] headers, [[array-of-tables]] blocks, inline tables, typed values, and dates — and the tool uses the @iarna/toml parser to build a data structure and serialize it as JSON, live as you type. You control whether the JSON is indented with 2 or 4 spaces. Because TOML's typed values and table syntax can be easy to get subtly wrong, malformed input produces a clear error message describing what the parser rejected, rather than failing silently. A footer reports how many keys the document contains and how many lines the JSON output spans, and you can copy the result or download it as a .json file. It is the inverse of the JSON to TOML tool and shares the same engine. Everything runs locally in your browser and is free to use.
How to Use
- 1Paste your TOML into the input panel, or click "Load example" for a sample document with tables and an array of tables.
- 2Pick the JSON indentation in Options: 2 spaces or 4 spaces.
- 3The JSON output renders live as you type; click "Convert to JSON" to confirm.
- 4If the TOML is malformed, read the inline error explaining what the parser rejected.
- 5Copy the JSON or download it as output.json; the footer shows the key and line counts.
Key Benefits
- Parses full TOML: tables, arrays of tables, inline tables, and typed values
- Choice of 2-space or 4-space JSON indentation
- Live conversion updates as you type
- Clear error message for malformed TOML instead of silent failure
- Preserves TOML types — numbers, booleans, and dates carry through correctly
- Key count and output line count shown in the footer
- Copy or download as .json; runs entirely in-browser with no upload
Common Use Cases
- Inspecting a Cargo.toml or pyproject.toml as JSON for a script or tool that expects JSON
- Converting a TOML config so it can be consumed by a JavaScript application
- Validating that a TOML file parses cleanly before deploying it
- Generating a JSON fixture from an existing TOML configuration
- Comparing the same settings expressed in TOML and JSON side by side
Options
0 characters · live
Paste TOML above to see the JSON live.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- Railway Config GeneratorBuild railway.json or railway.toml — build/deploy, restart policy, healthcheck, replicas, region, nixpacks — with a format toggle and audit
- Netlify Config GeneratorBuild netlify.toml — build, redirects (SPA fallback), headers, plugins, dev block, deploy contexts — with live TOML and an audit
- Color ConverterConvert between HEX, RGB, HSL, and HSV
- cURL to Code ConverterConvert cURL commands to code in various languages
- JSON Path FinderFind and test JSON paths
- npm to Yarn ConverterConvert npm commands and package-lock.json to Yarn equivalents
It uses @iarna/toml, a spec-compliant parser, so standard tables ([table]), nested and dotted keys, arrays of tables ([[items]]), inline tables, arrays, and all the scalar types — strings, integers, floats, booleans, and dates — are parsed and reflected in the JSON output.
Yes. The Options panel lets you choose 2-space or 4-space indentation, and the JSON re-renders immediately. The keys keep TOML’s ordering, formatted as a standard pretty-printed JSON document.

