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

Assistants and scripts can open JSON to YAML with its input already in the link, after the #, which never leaves your device:

  • #text= — the text to work on
  • #json= — the JSON document

Example: https://mygadgets.ink/tools/json-to-yaml/#text=...&json=... · also compressed gz fields and ?url=. How tool links work

Quick start: using JSON to YAML

  1. Paste the JSON you want to convert.
  2. Run the conversion to get indented YAML.
  3. Scan the output for values that YAML might reinterpret — versions, times, and yes/no words.
  4. Add quotes around any of those that must stay strings.
  5. 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.

JSON vs. YAML — same data, different style

JSON and YAML represent the same kinds of structure — objects, arrays, strings, numbers, booleans — so they convert cleanly in both directions. The difference is presentation:

  • JSON uses braces, brackets, and quotes. Compact, strict, machine-friendly.
  • YAML uses indentation and dashes instead of punctuation. Cleaner to read, supports comments, preferred for files humans edit by hand.

Because the underlying data model matches, converting is lossless for normal content.

YAML quirks to know

YAML's readability comes with its own sharp edges:

  • Indentation is significant. YAML uses spaces (never tabs) to show structure. Get the indentation wrong and the meaning changes or the file fails to parse.
  • The "Norway problem." Unquoted no, yes, on, off, true, and false are read as booleans. A country code list with NO for Norway can turn into false. Quote strings that could be misread.
  • Numbers vs. strings. A value like 1.0 or 007 may be interpreted as a number, dropping the trailing zero or leading zeros. Quote it to keep it as text.

A good converter handles quoting, but it is worth scanning the output for these cases.

Validate before you convert

Convert only valid JSON. If yours might be malformed, check it with JSON Validator and tidy it with JSON Formatter first. Garbage in, garbage out.

Common uses

  • Write Kubernetes, Docker, or CI configs from JSON data.
  • Convert an API response into a readable config format.
  • Move settings between systems that prefer different formats.

Related Developer Tools

Browse all Developer Tools →