YAML ⇄ JSON Converter
Convert YAML to JSON and JSON back to YAML — with parse errors reported by line number. Everything runs in your browser; nothing is uploaded.
How it works & supported YAML
The YAML parser is hand-rolled in vanilla JavaScript and supports the subset of YAML that covers almost all config files: block mappings and sequences with nested indentation, inline (flow) arrays [a, b] and objects {k: v}, single- and double-quoted strings, comments, literal | and folded > block scalars (with -/+ chomping), and scalar type inference for numbers, booleans, and null/~. Errors are reported with the offending line number.
Not supported: anchors and aliases (&anchor, *ref), tags (!!str, !custom), merge keys (<<), complex keys (?), multi-document streams (a second ---), and multi-line plain scalars. These raise a clear error instead of silently producing wrong output. JSON → YAML emits clean 2-space-indented block style and quotes strings only when required.