TOML to JSON
Convert TOML to JSON and JSON to TOML.
TOML to JSON and JSON to TOML Converter
Convert TOML to JSON to feed configuration files into tools and APIs that speak JSON, or convert JSON to TOML to produce clean, human-friendly config files. Both directions run instantly in your browser with a spec-compliant TOML 1.0 parser, and errors come with line and column numbers.
What is TOML?
TOML (Tom's Obvious Minimal Language) is a configuration format designed to be easy to read and map unambiguously to a hash table. It's used by Rust's Cargo.toml, Python's pyproject.toml, Hugo, Netlify, Deno, Poetry, and many CLI tools. TOML has tables ([section]), arrays of tables ([[item]]), inline tables, typed values, native dates, and comments.
TOML → JSON
- Tables become nested objects; arrays of tables become arrays of objects.
- Integers, floats, booleans, strings, and arrays keep their types.
- Dates and times become ISO 8601 strings, because JSON has no date type.
- Comments are dropped.
Use it to inspect a pyproject.toml with JSON tools, to test a config in code, or to pass settings to a service that only accepts JSON.
JSON → TOML
- Nested objects become
[table]sections, arrays of objects become[[array.of.tables]]. - Keys with special characters are quoted automatically.
- The JSON root must be an object, and
nullvalues aren't allowed — TOML has no null — so the converter tells you exactly where to fix the data.
Related tools
Check a TOML file on its own with the TOML Validator, or convert JSON to other config formats with JSON to YAML.
Frequently Asked Questions
How are TOML dates converted to JSON?
JSON has no date type, so TOML dates and times become strings. Offset date-times use ISO 8601 format (2026-09-30T08:00:00.000Z), local dates stay like 2026-09-30, and local times like 07:32:00.000.
Why does JSON to TOML fail with null values?
TOML has no null. Remove the key or replace null with an empty string, 0, or false before converting. The error message shows the path of the offending value.
Can the JSON root be an array?
No. A TOML document is always a table (key/value pairs), so the JSON must be an object at the top level. Put the array under a key, like {"items": [...]}, to convert it as an array of tables.
Are comments preserved?
No. JSON has no comments, so they're lost when converting TOML to JSON, and JSON to TOML output doesn't contain any. Keep the original TOML file if its comments matter.