How to convert JSON to YAML
- Paste JSON or choose a .json file.
- Leave the mode on From JSON and the language on YAML (preselected here).
- Read the YAML in the output.
- Copy it or download converted.yaml.
Worked example
{"name":"Ann","tags":["a","b"]} becomes four lines of YAML: name: Ann, then tags: with the list items - a and - b indented beneath it. The output downloads as converted.yaml.
Formats and limits
| Input | JSON |
|---|---|
| Output | YAML |
| Engine | js-yaml (YAML 1.2) and fast-xml-parser with validator |
Limitations
- Comments and trailing commas are not valid JSON and are reported as errors.
- Output is block-style YAML; flow style is not offered.
- Output is limited to 50 MB.
Questions
It reports a JSON error.
Fix the line and column shown. Comments and trailing commas are not valid JSON.
Does the key order change?
No. The YAML follows the JSON order; keys are not sorted.
Are strings such as yes or 123 kept as strings?
Yes. Strings that YAML would read as booleans or numbers are quoted so they stay strings.
Privacy
Runs on your device. Files and text are processed in this browser tab and are not uploaded.
This page opens the YAML and XML formatter and validator ready for this task. See the privacy policy for how toolsdocks handles data.