JSON to YAML Converter Online - Free & Private
Paste JSON and get YAML ready for Kubernetes manifests, Docker Compose, CI pipelines or any other config file. Choose the indentation, and optionally sort keys so the output is easy to compare.
How to convert JSON to YAML
- Paste JSON into the left editor, or open or drop a .json file.
- YAML appears on the right with syntax highlighting. If the JSON has an error, the status line shows the line and column so you can fix it.
- Copy the YAML or download it as a .yaml file.
Why convert JSON to YAML?
YAML is a superset of JSON that drops most of the braces, brackets and quotes, which makes it easier for people to read and edit. That is why Kubernetes, Docker Compose, GitHub Actions, GitLab CI, Ansible and OpenAPI files are usually written in YAML. A common workflow is to take a JSON response or a generated config and turn it into a YAML file you can commit and review.
What the output looks like
- Objects become indented
key: valueblocks, and arrays become lists of- itemlines. - Strings are quoted only when they need to be, for example when a value such as
"yes","08"or"null"would otherwise be read back as a boolean, number or null. - Multi-line strings are written as block scalars so line breaks stay readable.
Options
- Indent: two spaces is the common choice for Kubernetes and Compose files. Four is popular in Ansible.
- Sort keys: put keys in alphabetical order, which keeps diffs small when the file is under version control.
Example
{"service":{"image":"nginx","ports":["8080:80"]}} becomes:
service:
image: nginx
ports:
- 8080:80
Use the YAML to JSON converter to go back.
Private by design
Config files often hold hostnames and secrets, so the conversion runs only in your browser. Nothing you paste is sent to a server.