Mr. Encoder

JSON ↔ YAML Converter

Convert JSON to YAML and YAML back to JSON with configurable indentation.

How to use

  1. Paste JSON into the left pane or YAML into the right pane.
  2. Choose 2 or 4 space indentation.
  3. Click JSON → YAML or YAML → JSON and copy the result.

Frequently asked questions

What is the difference between JSON and YAML?

Both describe the same data structures (objects, arrays, strings, numbers, booleans and null). YAML uses indentation instead of braces and allows comments, which makes it popular for configuration files such as Docker Compose, Kubernetes and GitHub Actions.

Are YAML comments kept when converting to JSON?

No. JSON has no comment syntax, so comments are dropped. Anchors and aliases are resolved into their actual values.

What happens with a YAML file that has multiple documents?

If the YAML contains several documents separated by ---, the result is a JSON array with one element per document.

Why does my YAML fail to parse?

The most common causes are mixed tabs and spaces, inconsistent indentation and unquoted values containing ": ". The error message shows the line and column where the parser stopped.

Other tools