Kubernetes manifests, GitHub Actions, Docker Compose files and static-site front matter are all written in YAML, while the tools that generate configuration usually emit JSON. Paste the JSON file in and get tidy, human-readable YAML back.
How to convert JSON to YAML
- Click Select JSON files or drag them onto the box above. You can add as many as you like.
- Check that the target says YAML. Click the slider icon next to a file to change its options.
- Press Convert. Each file shows its own progress, and the work happens on your device.
- Download files one by one, or use Download all (ZIP). Press Convert more to start a new batch.
Going the other way? Choose a YAML file and JSON as the target; multi-document YAML files become a JSON array.
JSON vs YAML
What is JSON?
JSON is strict and machine-friendly: braces, brackets, quoted keys and no comments. More about the JSON format.
What is YAML?
YAML expresses the same data with indentation instead of brackets, which makes long configuration files far easier to read and review. YAML 1.2 is a superset of JSON, so every JSON document has an exact YAML equivalent. More about the YAML format.
| JSON | YAML | |
|---|---|---|
| Full name | JavaScript Object Notation | YAML Ain’t Markup Language |
| Extensions | .json | .yaml, .yml |
| MIME type | application/json | application/yaml |
When to convert JSON to YAML
- You generated a config with a script or API and need it in a YAML-based tool.
- You are converting an OpenAPI or Swagger spec from JSON to YAML for easier editing.
- You want to review a large JSON structure in a more readable form.
- You are moving settings into Helm values, Ansible variables or a CI file.
Quality and settings
The conversion is lossless for data: strings, numbers, booleans, nulls, arrays and nested objects map one-to-one, and key order is preserved. Strings that could be misread as other types, such as "yes", "0123" or "1e3", are quoted automatically so a YAML parser reads them back as the same strings. Long lines wrap at 120 characters. JSON has no comments, so there are none to carry over.