YAML to JSON

Convert YAML to JSON.

Loading…

Programs and APIs usually want JSON even when people wrote the settings in YAML. The converter also works as a checker: a wrong indent or a missing colon is reported with its line.

Anchors and aliases are expanded into plain values, and a file holding several documents separated by — becomes a JSON array.

How to use the YAML to JSON tool

  1. Paste YAML or open a .yaml or .yml file.
  2. Fix any error the message points to.
  3. Copy or download the JSON.
  • Checking a Kubernetes or CI file for syntax errors
  • Passing config values to a script that reads JSON
  • Seeing the real structure of a long YAML file

Tips for the best result

  • Most YAML errors are indentation: items of one list must start in the same column.
  • A value like no or on may be read as a boolean; quote it if you mean the word.

Quick facts

PriceFree
Works withText
Where it runsIn your browser, on your device
AccountNot needed

Frequently asked questions

Are comments kept?

No. JSON has no comments, so they are dropped.

What happens to anchors (&) and aliases (*)?

The referenced values are copied in wherever they are used.

Can it read several documents in one file?

Yes. They are returned as a list.

Why is my number in quotes?

It was quoted in the YAML, or it is something like a version number that is not a plain number.