Convert YAML (incl. multi-document) into JSON.
The YAML to JSON converter parses YAML and shows the equivalent JSON, updating as you type. It can turn a file with several --- documents into a JSON array and reports the line and column of syntax errors. Use it to inspect configuration as plain data or to feed YAML into tools that only accept JSON.
YAML is a human-friendly data serialization language. A parser reads indentation, dashes and colons and builds a tree of mappings, sequences and scalars, which JSON can express with braces, brackets and quoted strings. Plain scalars are resolved by type: true and false become booleans, null and ~ become null, numeric text becomes a number, and other text stays a string. Features that JSON lacks are resolved or dropped. Comments are discarded, anchors and aliases are expanded into copies of the data, and timestamps such as 2024-01-05 are written as plain strings. A file with several documents separated by --- holds several values, which this tool can collect into one JSON array. This tool uses the yaml library with its default YAML 1.2 rules, so yes and no stay strings and the << merge key is not applied.
Unquoted plain scalars are resolved by type. Put the value in quotes to keep it as a string.
They are discarded, because JSON cannot hold comments.
Aliases are replaced by a full copy of the anchored data. The << merge key is not applied by this tool and appears as a key called "<<".
It parses every document in the text and returns them as a JSON array. A trailing --- adds an empty document, which shows as null.
Yes. YAML 1.1 treated yes and no as booleans. The parser used here follows 1.2 by default, so they stay strings.
No. The conversion runs in the page and the text you enter is not sent anywhere.