Skip to content
{ }JSON Formatter

TOML to JSON Converter

Convert TOML to JSON — read any Cargo.toml or pyproject.toml as plain data, with spec-accurate parsing and exact error positions.

Input
Output
Paste input and press Convert to JSON.

Configs become data

You want to process a Cargo.toml, pyproject.toml or Hugo config in a script, feed it to a tool that only accepts JSON, or just see the structure that all those [table] headers build up. Paste the TOML, get plain JSON — tables become objects, [[arrays of tables]] become arrays of objects, and the whole shape is suddenly explorable in the tree viewer.

Spec-accurate, including the fiddly parts

  • Dotted keysa.b.c = 1 expands to nested objects, exactly per spec.
  • All four string types — basic, literal, and both multiline forms decode correctly, escapes included.
  • Dates and times — TOML has first-class datetime types; JSON doesn't, so they become ISO 8601 strings ("2026-07-03T12:30:00.000Z") — lossless and machine-readable.
  • Integer formats — hex 0xFF, octal, binary and underscored 1_000_000 all become plain JSON numbers.

Errors that point somewhere

Invalid TOML — a duplicate key, a missing quote, a table redefined — reports the exact line and column, consistent with every other tool on this site. And if you're going the other direction, JSON to TOML is the mirror page.

Frequently asked questions

What happens to TOML dates and times?

They become ISO 8601 strings in the JSON output — JSON has no datetime type, and the ISO string is the lossless, universally parseable representation. Your code can revive them with new Date(value) or the equivalent.

Why do [[bin]] sections come out as arrays?

Double brackets are the TOML array-of-tables syntax: each [[bin]] block is one element. The JSON shows them as an array of objects — that IS their meaning.

Does it understand dotted keys and sub-tables equally?

Yes. a.b = 1, [a] with b = 1, and [a.b] variants all build the same nested structure, exactly as the TOML 1.0 spec defines — the JSON output shows the merged result.

I get "duplicate key" errors on a file that other parsers accepted — why?

Redefining a key or table is illegal per the TOML spec, and this parser enforces the spec. Lenient parsers that silently take the last value hide a real config bug — the error position shows you where the collision is.