YAML ⇄ JSON Converter (Round-trip validation)

Convert YAML to JSON or JSON back to YAML, including YAML 1.2 features such as anchors, aliases, and merge keys. Use the Validate buttons to check round-trip equivalence while ignoring cosmetic differences like optional double quotes.

Options

How to use

  1. Paste YAML on the left and JSON on the right, or load files into each side.
  2. Select YAML → JSON or JSON → YAML to convert.
  3. Use the Validate buttons to confirm round-trip equivalence.

Notes

Equivalence checks compare the parsed data structure, so differences like optional double quotes are ignored. Anchors (&ref / *ref) and merge keys (<<: *ref) are supported. Everything runs locally with the bundled js-yaml library.

  • YAML and JSON differ in capability, so round-tripped files may not match originals byte for byte.
  • Comments - YAML supports # comments, but JSON has no official comment syntax. - Comments are therefore dropped when converting to JSON.
  • Anchors & aliases (&name, *name) - JSON has no anchor concept, so values are expanded when converting. - Returning to YAML does not recreate the original anchor notation automatically.
  • Key order - JSON does not guarantee object key order, so ordering may change.
  • Numeric formats - Leading-zero numbers (e.g., 0123), hex values, NaN, and Infinity fall back to strings in JSON.
  • Other differences - Minor presentation differences such as optional quoting are expected even though the data is equivalent.

All processing happens in your browser; no data is sent.