JSON to YAML
Convert JSON into readable YAML.
How to use JSON to YAML
What this tool does
This tool takes JSON and rewrites it as YAML. JSON and YAML model the same data — objects, arrays, strings, numbers, booleans and null — but JSON leans on braces, brackets and quotes, while YAML uses indentation and is far easier for a person to read and edit. The converter parses your JSON, then serialises the resulting data structure as clean YAML with the indentation you pick. The whole process runs in your browser, so nothing you paste is ever uploaded.
Why you might need it
JSON is the lingua franca of APIs, but YAML is what people actually maintain by
hand. You might have an API response, a package.json fragment or a generated
config blob in JSON and need it as YAML for a CI pipeline, a Kubernetes manifest,
a Docker Compose file or an application settings file. YAML’s lack of punctuation
noise also makes it the better format for anything a human will read regularly —
turning a dense JSON object into indented YAML often makes its structure obvious
at a glance. Converting is also handy when you want to comment a config: YAML
supports comments, JSON does not.
How to use it
- Paste your JSON into the input box, or drop a
.jsonfile onto it. - Choose the YAML indentation: 2 spaces or 4 spaces.
- Click Convert to YAML, or press Ctrl/Cmd + Enter.
- The YAML appears below; use the copy button to grab it.
- If the JSON is malformed, a clear error names where parsing failed.
Use the Load sample button to see a conversion straight away, and watch the byte counters to compare the size of the two formats.
Common pitfalls
The most common error is JSON that is not quite valid. JSON is stricter than the object syntax you write in JavaScript: every key must be in double quotes, strings cannot use single quotes, there can be no trailing comma after the last element, and comments are not allowed. A snippet copied from source code often trips on one of these. The error message gives you a line and column to start from.
On the YAML side, be aware that some string values get quoted automatically in the
output. The serialiser quotes any value that would otherwise be misread — a string
like yes, null, 12345 or one starting with a special character is wrapped in
quotes so it stays a string when the YAML is parsed back. That is correct
behaviour, not a bug: it guarantees the YAML round-trips to the same data.
Tips and advanced use
YAML output is excellent for code review. Convert a large JSON config to YAML before committing it and the diff becomes line-oriented and readable, with one key per line instead of a wall of braces. If you maintain the same configuration in both formats, convert in one direction here and keep the result as the source of truth to avoid drift. The converter keeps long strings on a single line, which means values like URLs or tokens never get folded across lines — convenient when you need to copy them. And because everything runs locally, converting JSON that contains credentials or private data is completely safe; none of it leaves your device.
Frequently asked questions
Is my JSON sent to a server?
Why does my JSON show as invalid?
Will the YAML output keep my key order?
Why are some long lines not wrapped?
Can I convert an array at the top level?
Related tools
Base64 Encoder & Decoder
Encode and decode Base64, with full UTF-8 support.
URL Encoder & Decoder
Encode and decode URL-safe text.
HTML Encoder & Decoder
Encode and decode HTML entities.
JWT Decoder
Decode and inspect JSON Web Token headers and payloads.
Regex Tester
Test regular expressions with live match highlighting.
UUID Generator
Generate v1 and v4 UUIDs in bulk.