YAML to JSON Converter

Parse YAML and convert to JSON, handling nested objects, arrays and types

What is it and how does it work?

YAML and JSON represent the same data model — key-value pairs, arrays, nested objects — but with completely different syntax. YAML uses indentation and minimal punctuation, making it a favourite for configuration files (Docker Compose, Kubernetes, GitHub Actions). JSON uses braces and quotes, making it the de-facto format for APIs and JavaScript applications. Converting between them is a constant need in DevOps and backend work.

This converter parses your YAML input and serialises it as pretty-printed JSON. It handles all YAML features that map to JSON: scalars, sequences, mappings, multi-line strings, booleans and null values. YAML-only features with no JSON equivalent — like anchors, aliases and merge keys — are resolved first, so the output is always valid JSON you can feed directly to any parser.

Common use cases

Frequently asked questions

Will YAML anchors and aliases be preserved in the JSON output?

No — but they are resolved first. An alias is replaced with the full content of its anchor, so the resulting JSON contains the correct merged data even though the alias syntax disappears. JSON has no equivalent shorthand.

Does the converter handle multi-document YAML (files separated by ---)?

Most YAML files contain a single document. This tool converts the first document. If your file uses --- separators, split it into individual documents first.

YAML booleans like yes, no, on, off — how are they converted?

YAML 1.1 (used by many parsers) treats yes, no, on, off, true and false as boolean values. They all convert to true or false in JSON. If you need the literal string "yes", quote it in YAML.

My YAML uses custom tags like !!python/tuple — will those work?

Language-specific tags cannot be represented in JSON. The converter uses a safe subset of YAML that matches the JSON data model. Custom tags will cause a parse error; remove them before converting.

JSON

JSON Formatter · JSON Minifier · JSON Validator · JSON to CSV · JSON ↔ YAML · JSON Flatten