How does YAML convert to JSON?
YAML and JSON describe the same kinds of data: objects, lists, strings, numbers and true or false. YAML is written with indentation and is popular for config files. JSON is stricter and is what most APIs expect.
Converting reads the YAML structure and prints it as JSON. Anchors (&a) and aliases (*a) are filled in with their values, and comments are dropped because JSON has none. The sample config, with a name, a flag, two tools and tags, becomes a JSON object with the same fields.
How to use the YAML to JSON Converter
- Paste your YAML on the left.
- Choose a 2 or 4 space indent for the JSON.
- Read the JSON result, or the error with line and column.
- Copy or download the JSON.