JSON to YAML
Convert JSON data into YAML format instantly with this free client-side converter. Secure, fast, and works directly in your browser.
Loading tool…
JSON and YAML: the same data, different clothes
YAML — a recursive joke standing for "YAML Ain't Markup Language" — was designed to be a human-friendly data format. It uses indentation instead of braces, needs no quotes around most strings, allows comments, and supports anchors for reusing blocks. Every valid JSON document is also valid YAML, because YAML 1.2 was defined as a superset of it.
The two formats therefore carry the same data model: mappings, sequences, and scalars. Converting means parsing the JSON into that model and emitting YAML's indented syntax. YAML's convenience does come with famous sharp edges — unquoted no and off can be read as booleans, version strings like 1.10 can be read as numbers, and indentation mistakes change meaning silently — so it is worth reading the output rather than pasting it blind into a production config.
Why we built this tool
The demand comes almost entirely from infrastructure tooling. Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, and OpenAPI specifications are all written in YAML, while the APIs and code around them emit JSON.
Those files describe your infrastructure and frequently include hostnames, bucket names, environment variables, and occasionally secrets that should never have been in there. Converting them through a website that uploads the content is a needless exposure of your deployment topology. This converter parses and re-emits entirely in your browser, so the manifest never leaves your machine, works with no network connection, and imposes no size limit on the document.
Tips and common mistakes
- Quote anything that looks like a version number, a time, or a yes/no word, or YAML will change its type.
- YAML is indentation-sensitive and forbids tabs — never mix the two.
- Add comments after converting; they are one of the main reasons to use YAML in the first place.
- Validate the result with your actual tool, since Kubernetes and CI systems apply their own schema checks on top.
Open JSON to YAML with a link
JSON to YAML can be handed its input by the link that opens it, so the page arrives with the work already done. This is meant for assistants and scripts: if a chatbot, an editor extension, or a command-line agent already holds your content, it can build a link instead of asking you to copy and paste into a box.
The payload rides in the fragment — the part of a URL after the #. Browsers never send the fragment to a server, so anything handed over this way stays on your device exactly as a dropped file would. A link that uses the query string instead is rewritten into the fragment by the page before any analytics or ad script can read the address.
Prefix any field with gz — #gztext= — to pass it as gzip-compressed base64url, which fits roughly five to ten times more into the same link. Links stay reliable up to about 8,000 characters; past that, chat apps and address bars start truncating them, and the page says so rather than loading half a document.
One exception to the privacy rule: ?url= tells the page to download the input from an address. That request goes from your browser straight to that server — not through ours — but it does leave your device, and it only works if the server allows cross-origin requests.
#text=— the text to work on#json=— the JSON document
Example: https://mygadgets.ink/tools/json-to-yaml/#text=...&json=...
Quick start: using JSON to YAML
- Paste the JSON you want to convert.
- Run the conversion to get indented YAML.
- Scan the output for values that YAML might reinterpret — versions, times, and yes/no words.
- Add quotes around any of those that must stay strings.
- Copy the YAML into your manifest or download it as a file.
The return trip is YAML to JSON. Validate the source first with JSON Validator if it came from an unfamiliar place.