JSON to YAML

Convert JSON into YAML.

Updated
Loading tool…

Convert JSON into YAML.

How to use JSON to YAML

  1. Paste your JSON into the input box
  2. Let it produce indented YAML with minimal quoting
  3. Copy the YAML for your config or pipeline
Try next →JSON FormatterFormat, repair and validate JSON.

About JSON to YAML

Paste JSON and get the equivalent YAML. The output uses YAML's indentation-based layout and adds quotes only where a value would otherwise be misread, so the result reads like YAML you would have written by hand rather than a mechanical dump. It is handy whenever you have JSON from an API response, a package.json, or a config file and you need it in the YAML that tools like Docker Compose, Kubernetes manifests, GitHub Actions, and other CI pipelines expect.

The same conversion covers the spec files people wrestle with most: drop in a Swagger or OpenAPI definition exported as JSON and get the YAML version many editors and generators prefer, or turn a CloudFormation template from JSON into the more readable YAML form. Because it reads strict JSON, a trailing comma or missing bracket shows an error instead of silently producing broken YAML, which lets you catch a malformed file before it reaches your pipeline.

Everything happens in your browser. Your JSON is processed with JavaScript on your own device, so nothing is uploaded to a server — safe to use even when a config holds private keys, tokens, or internal hostnames. There is no account, no file-size limit, and no watermark added to the output. Boring, but it works.

Frequently asked questions

Do I need an account?
No. The tool is free and needs no sign-up. There are no usage limits and nothing is added to the output, so you can convert as many files as you want.
Is my JSON sent to a server?
No. Everything runs in your browser and your JSON stays on your device. Because nothing is uploaded, it is safe to use with config that contains private values.
How do I use it?
Paste your JSON into the input box and the YAML version appears next to it. Copy it out when you are happy with it. There is nothing to install and no setup.
How is the YAML formatted?
The converter produces standard indented YAML and only adds quotes where a value would otherwise be ambiguous — for example a string that looks like a number or the word yes. The result reads like YAML you would write by hand.
What if my JSON is not valid?
If the JSON cannot be parsed — a trailing comma, a missing bracket, single quotes instead of double — you will see an error rather than YAML. Paste well-formed JSON and it will convert. The tool reads strict JSON, not loose JavaScript object notation with unquoted keys.
Can this also convert YAML to JSON?
This page converts in the JSON to YAML direction. If you already have YAML and want JSON, that is the opposite conversion, so you would reach for a YAML to JSON tool pointed the other way. The two are separate operations even though the formats hold the same data.
How do I convert a Swagger or OpenAPI JSON file to YAML?
Export or open your Swagger/OpenAPI definition as JSON, paste the whole document into the input, and the YAML version appears. Many API tools and code generators accept either format, and the output keeps the same structure so your paths, schemas, and components stay intact.
Can it convert a CloudFormation template from JSON to YAML?
Yes. Paste the JSON template and you get the YAML form, which is usually easier to read and to comment. Note that it produces plain YAML, so CloudFormation shorthand such as the !Ref short form is not added for you — the converted keys mirror whatever was written in the JSON.
How do I convert JSON to YAML in Python?
In Python you would load the JSON with the built-in json module and dump it with PyYAML, roughly json.load followed by yaml.safe_dump(data, sort_keys=False). This browser tool does the same thing without installing anything, which is handy for a quick one-off when you are not already in a script.
How does this compare to yq on the command line?
yq does the same job from a terminal, with something like yq -p json -o yaml. If you are already scripting or living in a shell, yq is a great fit. This tool is the point-and-paste version for when you just need one file converted and do not want to install a binary.
Does it handle nested objects and arrays?
Yes. Nested objects become indented YAML blocks and JSON arrays become YAML lists, so a deeply structured document converts in a single pass. Numbers, booleans, and null carry over as their YAML equivalents.