YAML to JSON Converter

Convert YAML to JSON online. Paste YAML, get formatted JSON instantly. Handles multi-document YAML, anchors, and references.

Converter
Direct answer

To convert YAML to JSON, paste your YAML below — formatted JSON appears instantly. Indentation becomes braces, dashes become arrays, and keys get wrapped in double quotes.

Ad
YAML input
JSON output

About YAML → JSON

Many tools — JavaScript runtimes, REST APIs, and most programming language standard libraries — natively understand JSON but not YAML. Converting YAML config to JSON is common when generating runtime configs from human-edited templates, debugging Kubernetes manifests, or piping config into tools that expect JSON input.

YAML vs JSON

 YAMLJSON
Parsing speedSlower (more rules)Faster (simpler grammar)
Library requiredYes (e.g. PyYAML, js-yaml)Built into most languages
StreamingDifficult (whitespace context)Easy (token-based)
Web APIsRareUniversal
Bytes on the wireMore compactMore verbose
Ad

Frequently asked questions

What happens to YAML comments?
They are dropped — JSON has no comment syntax. If you need comments in JSON, the convention is a "_comment" key at the top, but most parsers will preserve it as data.
Does this handle multi-document YAML (--- separators)?
It loads the first document only. If you have multi-document YAML, split the file and convert each document separately.
Why are some numbers being parsed as strings?
YAML auto-detects types based on shape. "1.0" is a number; "v1.0" is a string. Quoting any value with quotes always forces it to string.

Related tools