JSON to YAML converter
Convert JSON to YAML for config files and manifests, or YAML back to JSON, both ways in one place.
How to use it
- Pick the direction: JSON to YAML or YAML to JSON.
- Paste your text or open a
.json,.yamlor.ymlfile. The result updates as you type. - Choose 2 or 4 spaces of indentation.
- Copy the result or download it. Switching direction moves the current result into the input, so you can convert back and check.
What changes between the two formats
YAML is a superset of JSON for data: every JSON document is valid YAML, and YAML adds comments, anchors (&base) with aliases (*base), multi-line strings and several documents in one file separated by ---. Going from YAML to JSON, comments are dropped because JSON has none, aliases are written out in full, and several documents become one JSON array.
Strings that YAML would read as something else, such as "yes", "1.0" or text containing : , are quoted in the YAML output, so converting back gives the same JSON.
Long numbers
Integers longer than 15 or 16 digits, such as database IDs, are kept exactly in both directions. Most converters pass through JavaScript numbers and round them.
Related tools
Questions people ask
Is my file uploaded?
No. Conversion runs in your browser; nothing is sent to a server.
Does it keep YAML comments?
Comments cannot be kept in JSON, which has no comment syntax. To check or reformat YAML with its comments, use the YAML validator on this site.
Which YAML version does it read?
YAML 1.2, the version used by Kubernetes, Docker Compose, GitHub Actions and OpenAPI tooling.
Why did my YAML fail to convert?
The message names the line, the column and the problem. Tabs used for indentation are the most common cause; the YAML validator can replace them.