JSON to YAML Converter
Turn JSON into readable YAML for configs, pipelines and manifests.
How to use the JSON to YAML Converter
- Put your JSON in the left panel: paste it, open a .json file or drop one in.
- The YAML version is written on the right while you type. If the JSON has a mistake, the message names the line and column.
- Pick 2 or 4 spaces of indentation, and switch on key sorting when you want a stable order.
- Copy the YAML or save it as data.yaml.
Examples
About this tool
YAML can hold the same data as JSON: mappings, lists, text, numbers, true, false and null. It swaps braces, brackets and most quotation marks for indentation, which is why deployment manifests, CI pipelines and application settings are usually written in it. This converter parses your JSON and writes the equivalent YAML, so a response copied from an API or a package file can go straight into a config.
Quotes are added only where YAML needs them. Text such as yes, null, 007, 1.10 or 08:30 would come back as a boolean, an empty value or a number in many parsers, so those strings are quoted for you and survive a round trip. Text with line breaks becomes a block introduced by a | marker, and long sentences are folded at 80 characters unless you switch folding off under More options.
Tip: turn on key sorting before you commit generated YAML to version control. Two exports with the same content then produce identical files, and a later diff shows only real changes.
Frequently asked questions
Why are some strings quoted and others not?
A string is quoted when leaving it bare would change its type or break the syntax. Plain yes, no, on, off, null, ~ and number-like text such as 1e3 or 0123 are not text to a YAML parser, and values that start with characters like *, &, # or - have a special meaning. Ordinary words are left bare. Use "Quote all strings" if you want every text value in double quotes.
What do the | and >- markers in the result mean?
Both start a block of text that continues on the indented lines below. After | every line break is kept exactly. After >- the text was wrapped only for readability, and a parser joins the lines back together with spaces. Either way the value reads back as the original string.
What happens to comments in my JSON?
JSON has no official comment syntax, but hand-edited files often contain // or /* */ notes. With the forgiving option on they are skipped so the file still parses. They are not carried over, because the converter works on the parsed data rather than on the text.
Is my JSON sent anywhere during conversion?
No. The YAML is produced by JavaScript running in this tab, and no request carries your text off the device. Manifests that mention hostnames, tokens or passwords can be converted without leaving your machine.
Can I go back from YAML to JSON?
Yes, with the YAML to JSON tool linked below. Data that started as JSON survives the round trip unchanged, although key order is only identical if you leave sorting off.