How YAML maps to JSON
YAML 1.2 was designed as a superset of JSON, so every YAML mapping becomes a JSON object, every sequence an array, and scalars become strings, numbers, booleans or null. Comments are dropped because JSON has no comments. Anchors (&name) and aliases (*name) are expanded into full copies, and merge keys (<<: *defaults) are applied, so the JSON contains the effective values a program would see.
Files containing several documents separated by --- become a JSON array with one element per document. Block scalars keep their meaning: | preserves line breaks, > folds lines into spaces.
The type traps
Unquoted values are typed by YAML’s rules: 3 is a number, true is a boolean, and ~ or null is null. This parser follows YAML 1.2, where yes, no, on and off stay strings — but older YAML 1.1 tools (including PyYAML’s default loader) treat them as booleans, the source of the famous "Norway problem" where the country code NO became false. Version numbers like 2.10 are numbers unless quoted, so 2.10 becomes 2.1. Quote anything that must stay text.
Frequently asked questions
Are YAML comments kept?
No. JSON has no comment syntax, so comments are removed during conversion. If you convert back, they will not reappear.
What happens to anchors and aliases?
They are resolved: each alias is replaced by a copy of the anchored value, and merge keys (<<) are applied. The JSON shows the final, expanded data.
Why did my version number 1.10 become 1.1?
Unquoted 1.10 is a number in YAML, and numerically 1.10 equals 1.1. Write version: "1.10" with quotes to keep it as text.
Does it handle multiple documents?
Yes. A file with several --- separated documents (common in Kubernetes) is converted to a JSON array, one item per document.
Is my YAML uploaded?
No. Parsing uses the open-source yaml library running in your browser; nothing is sent to a server.