YAML to JSON Converter

Convert YAML (including multi-document files) to JSON and validate the syntax.

How do you convert YAML to JSON?

A YAML to JSON converter parses YAML — indentation-based configuration data — and writes the same data as JSON, which is easier to use in JavaScript, APIs and tools that only accept JSON.

What the converter supports

  • Nested mappings and lists
  • Multi-line strings (| and >)
  • Anchors and aliases (& and *)
  • Multiple documents separated by --- (output as a JSON array)

Validation

If the YAML is invalid, you get the error and the line where parsing failed — useful for finding the wrong indentation in a Kubernetes or CI file. Remember that YAML forbids tabs for indentation.

Convert the other way with the JSON to YAML Converter.

Frequently asked questions

Why does my YAML fail to parse?

The most common causes are tabs used for indentation, inconsistent indentation and a missing space after a colon.

What happens to comments?

Comments are not part of the data, so they do not appear in the JSON.

Can I convert several YAML documents?

Yes. Documents separated by --- are returned as a JSON array.