JSON to YAML Converter
Convert JSON to YAML or YAML to JSON in your browser. Handy for config files, free, and nothing you paste is uploaded.
Paste or type, or drop a file on the box.
Runs in your browser. Nothing you enter is uploaded or stored.
How to use the JSON to YAML Converter
- Choose JSON to YAML or YAML to JSON.
- Paste your data into the left box, or load the sample. The converted result appears on the right.
- Pick 2 or 4 spaces for the indent of the result.
- If the input is not valid, read the message under the boxes to find the problem.
- Copy the result, download it as a file, or press Swap to convert it back.
Questions and answers
- Is my data sent to a server?
- No. The conversion runs entirely in your browser. Nothing you paste is uploaded, stored or logged, so it is safe for Kubernetes manifests, CI pipelines and other configuration that holds private values.
- What is the difference between JSON and YAML?
- They describe the same kinds of data: lists, key and value pairs, text, numbers, true or false, and null. JSON marks structure with brackets, braces and quotes, and is what APIs speak. YAML uses indentation instead, allows comments, and is easier to read and edit by hand, which is why it is common for configuration files.
- Is anything lost when converting YAML to JSON?
- The data is kept, but YAML features that JSON does not have are not. Comments are dropped, and anchors and aliases are replaced by the values they point to. A YAML file with several documents becomes a JSON list with one item for each.
- Why are some strings quoted in the YAML?
- YAML would read some plain text as something else: “yes” and “no” as true and false in older parsers, “123” as a number, and “key: value” as a mapping. The converter adds quotes wherever leaving them off would change the meaning, so the YAML converts back to the same JSON.
- Does it keep the order of keys?
- Yes. Keys and list items come out in the same order they went in, in both directions.
- Can I convert a Kubernetes or Docker Compose file?
- Yes. Both are ordinary YAML, so they convert to JSON without trouble, including files that hold several documents separated by ---. Converting back from JSON gives valid YAML, though without the original comments.
Related tools
Number Base ConverterConvert numbers between binary, octal, decimal and hexadecimal, including very large values. Runs in your browser.Number to Words ConverterWrite any number or amount of money in English words, or turn words back into digits. Handy for cheques, invoices and contracts.JSON FormatterFormat, validate and minify JSON in your browser. Clear error messages, free, and nothing you paste is uploaded.XML FormatterFormat and validate XML in your browser. Indent messy markup, spot syntax errors, and keep your data on your device.YAML FormatterFormat and validate YAML in your browser. Fix indentation, catch syntax errors, and keep config files on your device.