YAML to JSON

Parse YAML and output clean, formatted JSON instantly. Handles block mappings, sequences, scalars, and quoted strings. Free, private, runs entirely in your browser.

100% private · runs locally

Paste any block-style YAML and get formatted JSON in seconds. The parser handles nested mappings, sequences, quoted strings, inline comments, and all common scalar types including booleans, integers, floats, and null.

YAML input
JSON output JSON

Related tools

Frequently asked questions

What YAML features are supported?

The parser handles block mappings, block sequences, all scalar types (string, integer, float, boolean, null), single and double quoted strings, and inline comments. Complex YAML features like anchors (&), aliases (*), tags, and multi-document streams are not supported.

How are YAML booleans converted?

YAML 1.1 accepts several boolean representations: true, yes, on become JSON true; false, no, off become JSON false. To preserve them as strings, wrap the value in quotes.

Why does indentation matter in YAML?

YAML uses indentation to define nesting, similar to how Python uses indentation for code blocks. Each level must be consistently indented by the same number of spaces (this tool expects two spaces per level). Mixing tabs and spaces or inconsistent indentation will cause parse errors.

How are comments handled?

YAML comments starting with # are stripped during parsing and do not appear in the JSON output. JSON does not support comments, so this information is intentionally discarded.