Convert YAML to JSON and JSON to YAML, with line-numbered errors
JSON to YAML Converter
Get YAML you can paste into a config file without a value quietly changing type.
Loading tool…
How to use json to yaml converter
Paste JSON or open a .json file.
Choose 2 or 4 spaces and whether to sort keys.
Keep multi-line strings as | blocks or turn that off for quoted strings.
Copy the YAML or download it as a .yaml file.
What this tool does
- Quotes strings such as "yes", "null", "0123" and "1e3" so no YAML reader turns them into booleans or numbers.
- Writes multi-line strings as literal | blocks with the right chomping sign so trailing line breaks survive.
- Lists of objects use the compact "- key: value" style common in Kubernetes and CI files.
- JSON errors are shown with line, column and a hint.
How the result is verified
The YAML written is read back with the tool's own YAML reader and compared with your JSON value for value.
Frequently asked questions
Why are some of my strings in quotes?
Only strings that would otherwise be read as something else are quoted: words like yes or null, number-like text, and text starting with characters YAML treats specially. Everything else stays plain.
Can I convert the YAML back?
Yes. Switch the direction to YAML to JSON and the YAML you just made becomes the input.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Validate YAML, fix indentation and view it as JSON
Beautify or minify JSON with your choice of indentation
TypeScript interfaces from a JSON sample, with optional keys
Find JSON syntax errors with the exact line and column