Skip to tool
All tools

JSON ↔ YAML ↔ TOML

Convert JSON, YAML and TOML either way.

Questions

What does this tool do?

JSON ↔ YAML ↔ TOML reads a document in any of the three, tells which it is by its shape, and writes it in the one you pick: JSON with two-space indent, YAML without anchors or a document marker, TOML with its tables and arrays of tables. What a format cannot say — TOML has no null and no top-level array — is said in a line instead of a broken file.

How does it know which format I pasted?

By the first line: a brace or a bracket is JSON, a [table] header or key = value is TOML, anything else is YAML. When the guess is wrong, pick the format under From; the rest follows.

Why does TOML refuse my document?

TOML has no null: a document with one cannot be written as TOML, and the page names the path so you can drop the key or give it a value. TOML also needs a table at the top: a bare list must go under a key first. JSON and YAML have neither limit.

How are dates and yes/no read from YAML?

As strings, the way YAML 1.2 reads them: 2026-09-13 stays text rather than becoming a date, yes and no stay words, and only true and false are booleans. TOML dates are written out as their text. Numbers, booleans and null cross as they are.

What about YAML anchors and the --- marker?

Anchors and aliases in the input are read and expanded — each alias becomes a copy of what it points to — and the output has none. A leading --- is fine; a file with several documents is read as one and refused.

Are numbers converted exactly?

Whole numbers are exact up to about 9 × 10¹⁵ and decimals to about 15 significant digits, the limits of the number type the page uses. A longer integer — a 64-bit id, say — loses its last digits on the way through; keep such values as strings.

Related tools