YAML ↔ JSON Converter

Convert YAML to JSON or back. Handy when you have a Kubernetes manifest that needs to become an API payload, or a JSON config you would rather maintain as readable YAML.

Runs entirely in your browser. Nothing you paste is uploaded.

Output
Converted output will appear here...

About the YAML ↔ JSON Converter

Every JSON document is valid YAML, since YAML 1.2 is a strict superset. The reverse is not true: YAML anchors, multiple documents in one file, comments, and multi-line block scalars have no JSON equivalent and are lost or rejected in conversion.

YAML's convenience comes with sharp edges. Indentation must be spaces, never tabs. And the old Norway problem still bites: in YAML 1.1 parsers, the unquoted country code NO parses as the boolean false, as do yes, on and off. Quote strings that could be misread.

Frequently asked questions

Is JSON valid YAML?

Yes, since YAML 1.2 is a superset of JSON. Any JSON document can be fed to a YAML parser unchanged.

What is the Norway problem?

YAML 1.1 parsers read the unquoted token NO as the boolean false, along with yes, on and off. The country code for Norway therefore becomes false unless quoted.

Why can't tabs be used for indentation?

The YAML specification forbids them outright, because tab width is ambiguous and indentation is structurally significant. Use spaces.