Toolstia / JSON to YAML converter

JSON to YAML and YAML to JSON converter

Paste JSON to get readable YAML, or paste YAML to get JSON. YAML is common in configuration files, Docker, Kubernetes and CI settings. Errors show the line and column.

Converted in your browser. This reads data only, and never runs any code inside the YAML. Comments in YAML are not kept when converting to JSON.

How it works

  1. Choose the direction.
  2. Paste your data, or press Use sample.
  3. Copy the result or download it.

Why YAML

YAML shows the same data as JSON but with indentation instead of brackets and quotes, which many people find easier to read and edit by hand. It is widely used for settings files.

Indentation matters

YAML uses spaces to show structure, and tabs are not allowed. A common error is mixed or uneven indentation, and the message tells you the line to check.

Safe reading

The converter only reads data. It does not run any code that might be hidden in a YAML file.

What is lost

Comments in YAML are not kept when converting to JSON, because JSON has no comments. Some YAML features, such as anchors, are expanded into plain values.

Questions

Is my data uploaded?

No. It is converted in your browser.

Why does it say the YAML is invalid?

Usually the indentation is uneven, a tab was used, or a colon is missing a space after it. The message shows the line.

Can it handle several YAML documents in one file?

No. Convert one document at a time.

Which YAML version?

The common YAML 1.2 rules used by most tools.