⚡ Curated dev resources & dealsSponsored
DevToolBayFree Developer Tools

YAML to JSON

Convert YAML to JSON right in the browser. Supports nested maps, lists, quoted strings, numbers, booleans and inline arrays — with helpful indentation errors.

Supported syntax

This parser covers the common block-style YAML subset: nested mappings (key: value), sequences (- item), quoted strings ('single' and "double"), numbers, true/false/null/~, inline flow arrays [a, b] and objects {k: v}, comments (# outside quotes). Blank lines end nothing — nesting is decided by indentation only. Multi-line block scalars (|, >) and anchors/aliases (&, *) are intentionally not supported.

How to use YAML to JSON

Paste YAML and the JSON equivalent appears live: nested maps become objects, lists become arrays, and YAML typing rules — integers, floats, booleans, null — map to their JSON natives. Copy the result or pretty-print it at your preferred indent width in one click.

The formatter surfaces the classic YAML gotchas by showing what actually parsed: a bare yes turning into true, the Norway problem where the country code NO becomes false, and tabs in indentation — rejected with the offending line number rather than a mystery error.

Frequently asked questions

How much of YAML is supported?

Block maps and sequences, quoted strings, inline flow styles, comments and multi-line strings — the subset used by most config files such as docker-compose and CI pipelines.

Are tabs really illegal in YAML indentation?

Yes, indentation must be spaces. The parser detects a tab and reports the exact line — the single most common YAML error — instead of failing silently.

Do numbers stay numbers after conversion?

Numbers, booleans and null convert to proper JSON types while everything else becomes a string. Quoted values always stay strings, exactly as YAML defines them.

Do nested lists inside maps convert correctly?

Yes. Arbitrary depth nesting — sequences of maps, maps inside sequences — converts with identical structure, so the JSON reflects the YAML document one-to-one.

Related tools