JSON to YAML: turn a JSON file into readable config
A before and after example, a private way to convert, and the one habit to watch when you edit the result.
By ClaudeGPT Si Newsroom · Editorial team
· 3 min read
JSON to YAML conversion takes data written with braces and quotes and rewrites it as indented YAML, which is easier to read and to add comments to. The quickest free way is to paste the JSON into AyeTab's converter, which turns it into YAML inside your browser without sending it anywhere.
Why go from JSON to YAML
Most of the time the data starts life as JSON: an API response, an exported setting, a sample from documentation. Then it has to live somewhere people edit by hand. Common cases:
- a Kubernetes or Docker Compose file built from a JSON example
- a CI workflow that needs a block copied from JSON docs
- an OpenAPI spec you want to keep in the more readable format
- config you plan to annotate, since YAML allows
#comments and JSON does not
A before and after
JSON in:
{"service": {"name": "billing", "replicas": 2, "ports": [8080, 9090], "debug": false}}
YAML out:
service:
name: billing
replicas: 2
ports:
- 8080
- 9090
debug: false
The data is identical. Braces become indentation, arrays become dash lists, and most quotes drop away.
Doing it with AyeTab
The AyeTab page has two panes, one for YAML and one for JSON. Paste your JSON into the JSON side and the YAML side fills in; each pane has its own copy button. It works the other way round too.
Why it is a good default:
| AyeTab | |
|---|---|
| Cost | Free, no signup |
| Your data | Parsed locally, not uploaded |
| Offline | Works once the page has loaded |
| Directions | JSON to YAML and YAML to JSON |
JSON copied from a production system often holds customer fields or tokens. Converting it in a tool that never leaves your browser keeps that data on your laptop.
After the conversion
The YAML you get is a starting point, not the finished file. A few small steps make it easier to live with:
- add
#comments that explain values a teammate might change - reorder keys if your team keeps a house style, such as name first
- paste the edited YAML back into the converter to confirm it still parses into the JSON you expect
One thing to watch
Going from JSON to YAML is safer than the reverse, because JSON is strict about types. The risk comes later, when someone edits the YAML by hand. A value typed as plain no or off may be read back as a boolean by parsers that follow YAML 1.1 rules. If a string matters, keep it in quotes.
When something else is better
For a whole folder of files, or a step in a build, a command-line tool fits better than a web page. yq converts JSON to YAML with yq -Poy sample.json. In Python, yaml.safe_dump from PyYAML writes YAML from the dict that json.load gives you.
Keep it on your new tab
The free AyeTab extension for Chrome puts this converter and its other developer tools on every new tab and in a side panel. Press Ctrl+K or Cmd+K, type "json", and pick the tool.
FAQ
How do I convert JSON to YAML online for free? Paste the JSON into the AyeTab converter and copy the YAML from the other pane. No account is needed.
Does converting JSON to YAML change my data? No. The values and structure stay the same; only the notation changes.
Can YAML hold comments that JSON cannot?
Yes. YAML supports # comments, which is one reason teams keep hand-edited config in YAML.