ENRU

YAML to JSON

No means "no". Unless you say YAML 1.1.

Input

Paste YAML. You get JSON with the numbers as written.

Converted as you type · drop a file on this pane

YAML guesses what you meant. I write down what it said.
— JSON Statham
OutputJSON
Example: on, 0x1F and an anchor in, "on", 31 and the expanded copy out.
Waiting for YAML.
Ln 1, Col 11:10 BAPI

Paste YAML to get JSON with the values YAML 1.2 actually means: numbers kept as written, anchors and merge keys expanded, and yes or no left as strings unless you ask for YAML 1.1. The conversion runs on our API; the text is never logged or stored.

How to convert YAML to JSON

  1. Paste YAML, open a .yaml file or drop one on the input.
  2. Pick the indent; tick YAML 1.1 booleans or All documents if your file needs them.
  3. Copy or download the JSON. The facts under it count every alias, boolean and number that changed form.

YAML 1.1 vs 1.2: no, on and 0x1F

YAML 1.1 readers such as PyYAML read no and on as booleans; YAML 1.2 reads them as strings. Here they stay strings by default, and the facts count them. Hex and octal numbers become decimals, 2.50 keeps its zero, a key repeated as 1 and "1" is an error, and tags with no JSON form, such as binary data or CloudFormation’s Ref, stop the conversion instead of vanishing.

YAML to JSON converter FAQ

Why is no a string and not false?

In YAML 1.2, the current version, only true and false are booleans. YAML 1.1 also read yes, no, on and off as booleans — the “Norway problem”. Tick YAML 1.1 booleans to read them the old way.

What happens to anchors, aliases and merge keys?

Each alias is replaced by a copy of its anchor, and merge keys (<<) are expanded in place, with the mapping’s own keys winning. The result is plain JSON without references; the facts say how many aliases were expanded.

Can it convert a file with several documents?

Yes: tick All documents, and the stream becomes a JSON array with one element per document. Without it, the second --- is an error, so nothing is dropped silently.

Is my YAML stored?

No. It goes to our API over HTTPS, is converted in memory and is never logged or stored. Usage statistics are tied to a random device ID and never include your YAML.

Other tools

Keyboard shortcuts

Everywhere
Ctrl+EnterRun the page’s main action
Ctrl+OOpen a file
Ctrl+SDownload the result
F8 / eJump to the error
/Focus the input
wWrap lines
cCopy the output
qAnother quote
?This help
EscClose

Keys like c, q, w work when the cursor isn’t in an editor.