All tools (39)
JSON to YAML
Convert JSON into readable YAML for configs, CI files and manifests.
Indent
Wrap at
Off, YAML quotes only what it has to.
Paste JSON to convert it to YAML.
JSON to YAML
Paste JSON and get YAML back as you type. Useful whenever a tool takes YAML but your data arrived as JSON: Kubernetes manifests, GitHub Actions workflows, Docker Compose files, OpenAPI specs, Ansible playbooks.
The options that matter
- Indent - two spaces is the near-universal convention. YAML forbids tabs for indentation entirely.
- Wrap at - YAML folds long scalars across lines at this width. Set it to never wrap if long strings must stay on one line, which some parsers and most diffs prefer.
- Indent list items under their key - whether
- itemsits indented beneath its key or flush with it. Both are valid; Kubernetes examples usually show the indented form. - Quote every string - off, YAML quotes only what it must. That is more readable, but be aware that
yes,no,onandoffare booleans in YAML 1.1 parsers, so a bare country code likeNOcan surprise you.
What does not survive the trip
YAML is a superset of JSON, so the conversion is lossless in this direction. Going the other way is not: YAML has dates, comments, anchors and non-string keys that JSON cannot express.
Related tools
- YAML to JSON - the other direction.
- JSON Formatter - tidy the JSON first.
- JSON to XML - a different target format.