Paste YAML on the left and click YAML → JSON, or paste JSON and click JSON → YAML. The output updates as you type, and Swap moves the result back into the input so you can round-trip a document.
YAML parsing uses the js-yaml library, loaded on demand and run locally in your browser. Files with several documents separated by --- are converted to a JSON array, one entry per document.
A few things to keep in mind:
- YAML comments, anchors and key order quirks do not survive a trip through JSON. Anchors and aliases are expanded into plain values.
- Unquoted values like
yes,onor1.0follow YAML 1.2 core schema rules, soyesstays a string and1.0becomes a number. Quote values when you need them kept as text. - Parse errors show the line and column where the problem starts, which is usually an indentation or tab issue.