JSON to YAML Converter

Paste JSON or YAML on either side — the other updates instantly. No libraries, no server.

JSON
YAML
About this tool

JSON to YAML Converter

JSON to YAML Converter translates in both directions, with formatting on either side. YAML is a superset of JSON, so anything valid as JSON converts cleanly, and the interesting direction is the other one.

How to use it

  1. Paste JSON on one side or YAML on the other.
  2. The conversion runs in the opposite panel.
  3. Format tidies the output, and Copy takes it.

Why YAML has more traps than JSON

YAML uses indentation for structure, which makes it pleasant to read and unforgiving to edit. Tabs are not permitted for indentation at all, and a single misaligned space changes which parent a key belongs to without producing an error.

The other trap is type inference. YAML 1.1 interprets a surprising set of unquoted words as booleans, which is how the country code NO becomes false and a version number like 1.10 becomes a float that loses its trailing zero. YAML 1.2 narrowed this, but many parsers still follow the older behaviour, so quote anything that could be misread.

When it helps

  • Converting a JSON config into YAML for a tool that expects it, like Docker Compose or a CI pipeline.
  • Turning a YAML config into JSON for a program that only parses JSON.
  • Checking what a YAML file actually resolves to, which is not always what it looks like.
  • Debugging an indentation problem by seeing the JSON equivalent.

Common mistakes

  • Using tabs to indent YAML. The specification forbids it and the error message is rarely helpful.
  • Leaving values like yes, no, on, off and version numbers unquoted, where type inference will change them.
  • Assuming a converted YAML file keeps its comments. Comments do not exist in JSON, so a round trip through it destroys them.
JSON to YAML Converter interface preview
Screenshot of the live JSON to YAML Converter interface.

v1.0