YAML to JSON Converter (and JSON to YAML)

Convert YAML to JSON and JSON to YAML online, with clear error messages. Handy for Kubernetes, Docker Compose, GitHub Actions and config files.

How to convert YAML to JSON

  1. Choose the direction: YAML → JSON or JSON → YAML.
  2. Paste your content. The result updates as you type, and if there's an error you'll see the line where it is.
  3. Copy the result, or use the button to convert it back.

Where YAML is used

YAML is the configuration format of Kubernetes, Docker Compose, GitHub Actions, GitLab CI, Ansible and many apps. Converting it to JSON helps validate it, use it in programs that only read JSON, or see the structure clearly when indentation is confusing.

Frequently asked questions

What's the difference between YAML and JSON?

They describe the same kinds of data (objects, lists, strings, numbers, true/false and null). JSON uses braces, brackets and quotes; YAML uses indentation and is easier for people to read and write, which is why it's popular for configuration. Every JSON document is also valid YAML.

Why does my YAML give an error?

The usual causes are tabs used for indentation (YAML only allows spaces), inconsistent indentation, a missing space after a colon, or special characters like : or # in a value that isn't quoted. The error message shows the line and column.

Are comments kept?

No. JSON has no comments, so they're dropped when converting YAML to JSON. Anchors and aliases (&name and *name) are expanded into full copies.

Is my file uploaded?

No. Conversion happens in your browser, so configuration files with secrets never leave your computer.

Related tools