Convert YAML to JSON

YAML is parsed into values and then serialized as JSON. Comments, anchors and formatting are not kept as source syntax; check dates and other typed values in the result.

Drop a file here or click to choose one — YAML

Processed entirely in your browser using a Web Worker. Nothing is uploaded.

When to convert YAML to JSON

Needed when a config written by people must reach something that only accepts JSON, such as a REST request body or a schema validator. Aliases are replaced by their full values, so repeated blocks appear in full and the output can grow. Comments vanish, which means the YAML should stay your source file and the JSON a generated artefact.

How it works

  1. Drop your YAML file into the box above, or click to choose one.
  2. Your browser parses it and rewrites it as JSON instantly — nothing is sent anywhere.
  3. Download the JSON file. That's it.

Questions

Does anything get lost converting to JSON?

YAML is parsed into values and then serialized as JSON. Comments, anchors and formatting are not kept as source syntax; check dates and other typed values in the result.

Are anchors and aliases kept?

Their values are kept, but not the syntax. In our test, an alias pointing to &b was expanded into a full copy of the object, because JSON has no way to express a reference.

Do comments survive?

No. JSON has no comment syntax, so every # comment is discarded while the data is parsed. Keep the YAML as your editable source if those notes matter.

Why did 0x10 become 16?

YAML reads it as a hexadecimal integer, and JSON stores plain numbers. In the same test, the word yes stayed the string "yes". Check typed values, and quote anything that must remain literal text.

Having trouble with this tool? Report an issue →