YAML ↔ JSON

Convert YAML to JSON or JSON to YAML instantly, with anchors, multi-document YAML and safe quoting of yes/no values. Free online converter.

About this tool

Convert YAML to JSON and JSON to YAML. Anchors and aliases are resolved, multi-document YAML becomes an array, and ambiguous strings are quoted in the YAML output.

How to use

  1. Choose YAML → JSON or JSON → YAML.
  2. Paste the document.
  3. Copy the converted output; parse errors are shown below the input.

Frequently asked questions

Why are yes and no quoted in the YAML output?

YAML 1.1 parsers such as PyYAML read unquoted yes/no/on/off as booleans. Quoting keeps them strings for every parser.

Are comments kept?

No. JSON has no comments, so comments are dropped when converting YAML to JSON.

What happens with several YAML documents?

Documents separated by --- are returned as a JSON array.

Related tools