How to use
- Choose YAML → JSON or JSON → YAML.
- Paste your data and it converts instantly | docker-compose.yml, a GitHub Actions workflow, a Kubernetes manifest, package.json, anything.
- Adjust indentation (2 or 4 spaces), quote style, or folding of long strings.
- If the syntax is wrong, you get the line and column with the spot highlighted.
- Copy or download the result, or press Use result as input to convert it back the other way.
How JSON and YAML map
YAML 1.2 is a superset of JSON, so every JSON document is already valid YAML. Features that exist only in YAML are handled like this when converting to JSON:
| YAML | JSON result |
|---|---|
# comment |
Dropped (JSON has no comments) |
Anchors and aliases &base, *base |
Content copied in place |
Merge key <<: *base |
The anchor’s keys merged in |
Multiple documents --- |
Wrapped into one array |
Block strings |, > |
| keeps line breaks, > joins lines with spaces |
.inf, .nan |
null, since JSON can’t represent them |
Watch out for yes, no, on and off
This tool reads YAML with the YAML 1.2 core schema, so yes, no, on, off, y and n are strings, not booleans | only true and false are booleans. Programs that follow YAML 1.1, such as Python’s PyYAML, read country: NO as false (the well-known “Norway problem”). That’s why JSON → YAML quotes strings like "yes" and "on", plus number-like strings such as "01234", so they stay strings whichever parser reads them.
- Date-like values such as
2026-10-05also stay strings. - A key that appears twice is reported as an error in YAML (the JSON spec leaves it undefined).
- Indentation must use spaces, never tabs. “bad indentation” usually means a line’s indent doesn’t line up with its neighbors.
FAQ
Are dangerous YAML tags executed?
No. Executable tags such as !!js/function aren’t supported and produce an error. Inputs that nest aliases to exhaust memory (“billion laughs”) are stopped before expansion.
Can I tidy the JSON first?
The JSON Formatter offers indentation, key sorting and precise error locations. To compare before and after, use Text Diff. Nothing you paste is uploaded.