YAML ↔ JSON Converter
Convert between YAML and JSON formats instantly.
Last updated: August 2026
Was this tool helpful?
Converting between YAML and JSON
YAML and JSON describe the same kinds of data: maps, lists, strings, numbers, and booleans. JSON is strict and brace-heavy, which machines love. YAML is indentation-based and comment-friendly, which humans prefer for config files like CI pipelines and Kubernetes manifests. A converter lets you move a payload from one world to the other without retyping. In fact JSON is a subset of YAML, so any valid JSON is already valid YAML.
The whitespace trap
YAML is whitespace-sensitive. Indentation defines structure, and tabs are forbidden for indentation, so a stray tab or an off-by-one space silently changes nesting or throws a parse error. JSON does not care about whitespace at all. This is the single most common reason a YAML to JSON conversion fails, so the converter should point to the exact line.
Example
YAML input:
name: api
ports:
- 8080
- 8081
debug: falseJSON output:
{
"name": "api",
"ports": [8080, 8081],
"debug": false
}FAQ
Why did my comments disappear? JSON has no comment syntax, so YAML comments are dropped on the way to JSON and cannot be recovered on the way back.
What is the Norway problem? Unquoted no, yes, on, and off are read as booleans in older YAML. The country code NO can become false. Quote strings that could be mistaken for booleans.
Does key order survive? Mapping order is usually preserved both ways, but neither spec guarantees it, so do not rely on order for correctness. Use the JSON formatter to tidy the result.