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
| YAML | JSON | |
|---|---|---|
| Parsing speed | Slower (more rules) | Faster (simpler grammar) |
| Library required | Yes (e.g. PyYAML, js-yaml) | Built into most languages |
| Streaming | Difficult (whitespace context) | Easy (token-based) |
| Web APIs | Rare | Universal |
| Bytes on the wire | More compact | More 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.