Developer Tools

YAML to JSON Converter

Parse real-world YAML — anchors, aliases, multi-line strings, nested lists — and emit clean JSON with your chosen indentation.

100% browser-side processing — nothing is uploaded

YAML → JSON: Parse YAML (anchors, multiline) into JSON. Output updates live as you type — or press Ctrl/Cmd + Enter.

Results update live as you type.
11 lines · 0.19 KB
1 lines · 0.00 KB

Related tools

How to convert YAML to JSON

  • Paste YAML

    Config files, Kubernetes manifests, CI workflows — full YAML syntax is supported, including anchors and multi-line strings.

  • Convert

    The JSON output is formatted with your chosen indentation. Parse errors report the offending line.

  • Use downstream

    Copy or download the JSON, validate it, or chain it into CSV, flatten, or diff actions in the studio.

Full YAML is more than indentation

Real configuration YAML uses features casual converters miss: anchors (&base) and aliases (*base) that reuse blocks, merge keys (<<:) that compose defaults, literal (|) and folded (>) multi-line strings, and explicit tags. This converter uses a complete YAML parser, so those constructs resolve correctly — an alias expands to its anchored value in the JSON output, and a literal block becomes a string with its line breaks preserved as \n.

The gotchas YAML is famous for

YAML’s convenience syntax has sharp edges worth knowing when you inspect the JSON output. Unquoted no, off, and n were booleans in YAML 1.1 — the infamous "Norway problem" where a country code becomes false; modern parsers treat them as strings, but quoted values are always safest. Unquoted version numbers like 3.10 parse as the number 3.1. And tabs are illegal for indentation — a mixed-tabs file fails with a pointer to the offending line. Converting to JSON is actually a good audit: types become explicit, so surprises surface immediately.

YAML to JSON Converter FAQ

Are anchors and aliases supported?

Yes. Anchors (&name), aliases (*name), and merge keys (<<:) resolve during parsing, so the JSON output contains the fully expanded data.

What happens to comments?

JSON has no comment syntax, so YAML # comments are dropped during conversion. The data itself is preserved completely.

Why did my value 3.10 become 3.1?

Unquoted 3.10 is a number in YAML, and numbers don’t keep trailing zeros. Quote it in the source ("3.10") to keep it a string — the same applies to version numbers and ZIP codes.

Can I convert multi-document YAML?

Files with --- separators contain multiple documents; the converter parses the first document. Split the file to convert each document separately.

My file fails with a tab error — why?

YAML forbids tab characters in indentation. Replace tabs with spaces (most editors have a convert-indentation command) and the parse will succeed.