Convert TOML to JSON
Turn a TOML config file into JSON.
About this converter
Usually to read a config file from a script, or to see what a set of sections and array-of-table blocks actually amounts to once it is a single structure.
TOML has two types JSON does not, and both are handled rather than allowed to break the conversion. Dates and times are real values in TOML, and they become ISO 8601 strings. Integers are arbitrary precision, so a number too large to hold exactly as a JSON number becomes a string instead of quietly losing its last few digits.
Everything else maps directly: a [section] becomes a nested object, a [[block]] becomes a list of objects, and the plain values come across as they are.
Frequently asked questions
Why is my date a string?
JSON has no date type. TOML does, so the value is written as an ISO 8601 string — 2024-03-01T14:30:00.000Z — which is the closest thing JSON offers and what every date library reads.
Why is one of my numbers a string?
Because it is too large to hold exactly as a JSON number. TOML integers are arbitrary precision and JSON numbers are doubles, so past about 9 quadrillion the digits start changing. A string keeps the value; a number would have altered it without saying so.
Do comments survive?
No. TOML has comments and JSON has none, so they are lost. If the file is the source of truth, keep the TOML and generate the JSON.
Does what I paste get sent anywhere?
No. The conversion runs in your browser, on your own machine — which is why the result appears as you type. Nothing is uploaded and nothing is logged. That matters for this kind of tool in particular: config files and API responses are exactly the things that carry keys, hostnames and customer data.