TOML to JSON
Convert Cargo.toml, pyproject.toml or any TOML file to JSON; errors are shown by line and column
Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.
Did this tool do the job?
Thanks, your feedback came through.
How it works
To hand a TOML config to JavaScript, jq, an API or a tool that cannot read TOML, you first need it as JSON. Paste the file's contents into the left pane and the JSON appears on the right. In the sample, the [database] header becomes a "database" object and the [[warehouse]] header, written twice, becomes a "warehouse" array with two records. Numbers with underscores such as 12_000 become plain 12000, and # comment lines are dropped because JSON has no comments. JSON has no date type either, so updated = 2026-09-27T09:00:00-05:00 becomes an ISO string with the same spelling; local dates (2026-09-27) and local times (09:00:00) become strings too. The page is also a TOML validator: if the text is invalid, nothing is converted and the line and column of the problem are shown, with a likely cause where possible (for example "The same key or [table] is defined twice"). Set Direction to "JSON → TOML" and the same page works the other way.
This tool is also known as toml to json, toml to json converter, toml validator, convert toml to json, cargo.toml to json.
What is TOML file?
A TOML file is a settings file with the .toml extension, made of key = value lines and [section] headers. Rust projects keep their dependencies in Cargo.toml, Python projects keep package metadata and tool settings in pyproject.toml. The format is meant for people, so comments are allowed, but its syntax is strict and a single bad line stops the whole file from loading.
What is ISO 8601 date format?
ISO 8601 is the international standard that writes dates and times from the largest unit to the smallest: 2026-09-27 is a date, 09:00:00 a time, and 2026-09-27T09:00:00-05:00 a moment in US Central Daylight Time. The trailing -05:00 is the offset from UTC, and Z means UTC itself. TOML writes dates this way and they reach JSON as strings in the same format, so any language can turn them back into dates without loss.
What is the difference between validating TOML and converting it to JSON?
Validation only answers whether the text follows the TOML rules; conversion rewrites valid text in another format. This page does both in one step: if the text is invalid, conversion stops and the error location is shown; if it is valid, JSON appears. A file that is valid TOML may still not match what the program reading it expects: a missing name field in the [package] table of Cargo.toml is a Cargo error, not a TOML error, and only that tool can check it.
Pitfalls: dates, large numbers and inf/nan
TOML has four date-time types (offset date-time, local date-time, local date, local time); JSON has none. The tool turns all of them into ISO 8601 strings and says in the note how many it converted; the program reading the JSON has to parse those fields back into dates. JavaScript dates have millisecond precision, so a time with microseconds such as 00:32:00.999999 is written as 00:32:00.999.
TOML integers are 64-bit, while JavaScript numbers round integers above 2^53. The tool reads such numbers separately and writes them to JSON digit for digit (9223372036854775807 stays intact). TOML's inf and nan have no JSON equivalent; they become null and the note warns you. Whole-valued floats such as 72.0 are written as 72 in JSON; the numeric value is the same.
Using it as a validator, and common mistakes
When Cargo or pip only says "invalid TOML" about a file, paste the text here to see the line and column. The most common causes are a key or [table] written twice, unquoted text (name = "Jane", not name = Jane), two key = value pairs on one line, and booleans written True/False instead of lowercase true/false. A date that does not exist in the calendar (2021-02-29) also counts as an error: some TOML readers silently shift it to March 1, while this page stops and shows the line.
If the text is valid, the JSON appears on the right and the note shows the number of keys, a sign that the file follows the TOML rules (version 1.1; 1.0 files pass too). The reader behind the page is the open-source smol-toml library, which passes the official toml-test suite and runs inside the page.
Frequently asked questions
How do I convert a TOML file to JSON?
Paste the TOML text into the left pane on this page; the JSON appears on the right. [table] headers become objects and [[table]] headers arrays of objects. Copy the result or download it as a .json file.
How can I check whether my TOML file is valid?
Paste its contents here. If it is valid, JSON appears on the right; if not, the line, column and likely cause of the error are shown. The check follows the TOML 1.1 rules (1.0 files pass too); tool-specific rules such as a required name field in Cargo or Poetry are not checked.
Why did the dates become strings in JSON?
JSON has no date type, so TOML date-time values are written as ISO 8601 strings (for example "2026-09-27T09:00:00-05:00"). The program reading the JSON has to turn those strings back into dates; every common language reads the ISO format directly.
Is my file sent to a server?
No. The TOML is read entirely in your browser by an open-source reader bundled into the page, so even a config file with passwords or access keys never leaves this page. Once loaded, the page also works offline.