TOML to JSON Converter
Convert TOML configuration such as Cargo.toml or pyproject.toml to JSON, with exact 64-bit integers and ISO 8601 dates.
This guide is not yet available in your language and is shown in English.
Tool guide
What this tool does
TOML to JSON Converter parses TOML 1.0 documents, including tables, arrays of tables, inline tables, dotted keys, multi-line strings and dates, and outputs formatted JSON. Integers beyond JavaScript’s safe range are written exactly, inf and nan are handled explicitly, and syntax errors are reported with line and column.
TOML is the configuration format of Rust (Cargo.toml), modern Python packaging (pyproject.toml), Hugo, Netlify and many other tools. It is easy for people to edit, but scripts, dashboards and APIs usually want JSON, and TOML has features JSON lacks, such as dates and 64-bit integers, which need careful handling.
This converter uses smol-toml, a parser that follows the TOML 1.0 specification, loaded only when needed. Tables become nested objects, [[arrays of tables]] become arrays of objects and dotted keys such as server.port expand into nesting. TOML integers can be up to 9,223,372,036,854,775,807, beyond the 2^53 limit of JavaScript numbers, so large values are written as exact JSON numbers or, if you prefer, strings. Dates and times become ISO 8601 strings. Parsing happens locally in your browser.
How to use TOML to JSON Converter
- Paste TOML into TOML input, open a .toml file, or click Sample.
- Choose the JSON Indentation or Minified output.
- Decide how Integers larger than 2^53 should be written: exact numbers or strings.
- Choose whether inf and nan become strings or null, since JSON has no such numbers.
- If an error appears, correct the reported line and column; the JSON updates as you type.
- Copy or download data.json, or convert several TOML files at once.
Tips for better results
- Pick Strings for large integers if the JSON will be read by JavaScript, which would otherwise round them silently.
- Local dates such as 2019-04-01 stay date-only strings, while offset date-times keep their offset, so no time zone information is invented.
- Underscores in numbers such as 1_000_000 are only for readability in TOML and disappear in JSON.
- Use JSON to TOML to go back the other way after editing values in a script.
Common use cases
- Reading Cargo.toml or pyproject.toml metadata in a CI script that only understands JSON.
- Inspecting a Hugo, Netlify or Starship configuration file as structured data.
- Migrating configuration from TOML to a JSON-based system.
- Debugging a TOML file that a tool refuses to load.
Common mistakes to avoid
- Defining the same table twice, such as two [server] headers; TOML forbids it and the parser reports the second one.
- Writing bare strings without quotes, for example name = inventory; TOML strings must be quoted.
- Assuming key order in JSON matters to the consuming program; objects are unordered, so read values by key.
Frequently asked questions
Which TOML version is supported?
TOML 1.0.0, the current stable specification, including tables, arrays of tables, inline tables, dotted keys, literal and multi-line strings, and offset, local date-time, date and time values.
How are TOML dates converted?
They become ISO 8601 strings. Offset date-times keep their offset or Z, local date-times have no zone, and local dates or times contain only the date or time part.
Why are some numbers so long in the output?
TOML allows 64-bit integers. They are written exactly so no digits are lost, but JavaScript can only represent integers up to 9,007,199,254,740,991 exactly, so choose Strings if a JavaScript program will read the file.
Are TOML comments kept?
No. JSON has no comment syntax, so comments are removed during conversion.
Feedback & suggestions
Help us improve TOML to JSON Converter. We read every message.