TTKTheTextKit

TOML to JSON Converter

Paste a TOML file such as pyproject.toml or Cargo.toml to get JSON, or switch direction and turn a JSON object into TOML. The reader checks the file against TOML 1.0 and points to the line and column of the first mistake, so the tool also works as a TOML validator. Everything runs in your browser.

JSON has no date or time type, so dates and times are written as text.

The reader follows TOML 1.0 and refuses anything outside it, with the line and column. Comments are not carried over, because JSON has none. Dates and times become text in JSON, and in the other direction they stay text. Whole numbers are kept exactly. Nothing you paste or open is uploaded: everything runs in your browser.

Related Tools

[6 suggestions]

About the TOML to JSON Converter

TOML is a configuration format built from key = value lines grouped under [table] headers. A header such as [server] starts a table, [[users]] adds one more item to a list of tables, a dotted key such as retry.times builds a nested table on one line, and { x = 1 } is an inline table. In JSON these become objects and arrays. The converter is strict: it refuses a key or a table that is defined twice, an inline table that spans lines or ends with a comma, numbers with leading zeros, dates that do not exist and unquoted text, and it says where the problem is. Some values need care. JSON has no date type, so TOML dates and times are written as strings. JSON has no infinity or not-a-number either, so inf and nan become strings. Whole numbers are copied digit for digit, but programs built on JavaScript round whole numbers larger than 9,007,199,254,740,991, and the tool warns you when one appears. Comments are dropped, because JSON has none. Going from JSON to TOML, the top level must be an object. Nested objects become [table] sections and arrays of objects become [[array]] sections, with plain values listed before the tables because TOML requires that order, so the key order can change. TOML has no null: by default the tool stops and names the key, and you can choose to leave null values out instead, except inside a list. The tool follows version 1.0 of TOML, so syntax added in later versions is reported as an error. Everything runs in your browser and nothing you paste is uploaded.

How do I convert TOML to JSON?▾

Paste the TOML into the first box. The JSON appears below as you type, ready to copy or download. If there is a mistake, you get the line and column instead.

Can I use it to validate a TOML file?▾

Yes. The reader follows TOML 1.0 and reports the first error with its position, such as a duplicate key, a missing quote or an impossible date. No error means the file parsed.

What happens to dates and times?▾

They become JSON strings, such as "2027-03-15T09:30:00Z", because JSON has no date type. Converting that JSON back to TOML keeps it as a string.

Why does JSON to TOML fail on null?▾

TOML has no way to write null. Tick Leave out null values to drop keys that are null. A null inside a list cannot be dropped without changing the list, so it stays an error.

Are comments kept?▾

No. JSON has no comments, so they are lost in conversion. Keep your original TOML file.

Is my configuration file uploaded?▾

No. It is converted in your browser, which matters for files that hold passwords or tokens. Nothing is sent or stored.