JSON to YAML
Config-friendly output from any JSON document.
YAML is the format of choice for configuration: Kubernetes manifests, CI pipelines, Docker Compose, Ansible. Paste JSON here and get equivalent YAML you can drop straight into a config file.
YAML forbids tab indentation, so the output always uses spaces. Ambiguous scalars are quoted so they cannot be re-read as booleans or numbers.
Input JSON
YAML output
Paste valid JSON to see the output.
JSON and YAML
YAML 1.2 is a superset of JSON, so every valid JSON document is already valid YAML. Converting it into idiomatic YAML — indentation instead of braces, dashes instead of brackets, unquoted scalars where they are unambiguous — is what makes it comfortable to edit by hand.
How to convert
- Paste or upload your JSON.
- Choose an indentation width.
- Copy the YAML, or download it as a .yaml file.
Things to watch for
- Strings such as yes, no, on, off and version numbers like 1.10 can be read as booleans or numbers by older YAML parsers. Jsonviewpro quotes values where that ambiguity would change the meaning.
- YAML forbids tab characters for indentation. The converter always emits spaces.
- Very long strings are wrapped for readability. Turn the line width up if your tooling needs single-line values.
Converting back
The YAML to JSON tool goes the other way, and reports YAML syntax errors with a line and column.
Frequently asked questions
Is every JSON document convertible to YAML?
Yes. YAML 1.2 is a superset of JSON, so any valid JSON has a YAML equivalent.
Which indentation does the output use?
Spaces — two by default, configurable. YAML does not permit tab indentation.
Are comments preserved?
JSON has no comments, so there are none to preserve. Converting YAML to JSON does discard the YAML comments.
Related JSON tools
- YAML to JSONConvert YAML config into valid JSON.
- JSON FormatterPretty-print messy JSON with your choice of indentation.
- JSON ViewerExplore JSON as a collapsible tree with search and copyable paths.
- JSON ValidatorCheck syntax with precise line, column and cause.
- JSON to CSVTurn arrays of records into a spreadsheet-ready CSV.