How YAML-to-JSON conversion works
YAML and JSON describe the same kinds of data — mappings (key/value), sequences (lists) and scalars (strings, numbers, booleans, null) — but YAML uses indentation and is easier for humans to read, while JSON uses braces and is what most APIs and config loaders expect. In fact, JSON is a subset of YAML, so every JSON document is already valid YAML.
This converter parses your YAML's indentation into a nested data structure, then serializes it with JSON.stringify for clean, two-space-indented output you can paste straight into code.
Worked example
The YAML tags: followed by indented - free and - private becomes:
name: Calcool → "name": "Calcool".["free", "private"].uploads: false → boolean, count: 117 → number, ratio: 1.5 → number.Supported syntax
This is a focused, dependency-free parser that covers the YAML people write by hand: block mappings, block sequences, nesting by indentation, inline comments (#), quoted and unquoted scalars, and automatic typing of true/false, null and numbers. It intentionally leaves out advanced features like anchors, aliases, multi-document streams and complex multi-line block scalars, which need a full YAML library. For everyday config files it produces exactly the JSON you'd expect.