🌐 English

Home › Data & text

JSON ⇄ YAML Converter

Convert config files between JSON and YAML. Paste and choose a direction.

🔒 What you enter never goes to a server — every calculation happens on your device (in your browser).

How to use

  1. Paste what you want to convert.
  2. Press “JSON → YAML” or “YAML → JSON”.
  3. Copy or download the result.

When to use it

Check YAML configs for Kubernetes, Docker Compose or GitHub Actions with JSON tools, or read API response JSON as easier-to-read YAML.

Things to know

YAML comments can't be carried into JSON and are dropped. Unquoted values like yes, no, on and off may be read as true or false depending on the YAML version — quote them to keep them as text.

How the two formats differ

JSON marks structure with braces, brackets and quotes, which suits programs exchanging data. YAML marks structure with indentation, which suits people who read and edit it by hand. The same data can be written in either shape, so people often move back and forth depending on the situation.

A typical pattern is keeping a configuration file in the easier-to-read YAML, then converting it to JSON when you want to validate it or hand it to another system. In the other direction, a long JSON response from an API is sometimes easier to understand once it is turned into YAML, because the nesting depth becomes visible.

What to check after converting

In YAML, indentation is the structure, so being off by a single space can change the meaning or cause an error. When you paste the result into another file, confirm that the leading spaces were kept. Tab characters cannot be used for YAML indentation; only spaces work.

Also look at the type of each value. Unquoted words like true or null, or anything that looks like a number, is read as a boolean, nothing, or a number rather than as text. Phone numbers and version numbers that must stay text should be wrapped in quotes so they survive as you intended.

FAQ

What about YAML with several documents (---)?

Only the first document is converted for now.

What indentation is used?

YAML is written with 2 spaces.

Anchors (&) and aliases (*)?

They're expanded when converting YAML → JSON.

Is my input uploaded?

No. It's converted in your browser.

What happens to comments when I convert?

JSON has no comments, so comments in YAML disappear when you convert to JSON. Converting back to YAML will not bring them back, so keep the original if the comments matter.

If I go JSON to YAML and back, do I get the same thing?

The data values come back the same. The surface appearance, such as whitespace, how keys are written and whether quotes are used, may differ, and comments are not preserved as mentioned above.

I get an error. Where should I look?

On the JSON side, check commas and quotes first. On the YAML side, check indentation and the space after the colon (key: value). A list item's dash also needs a space after it.