YAML ↔ JSON Converter

Paste YAML or JSON — the tool detects the format and converts it to the other.

Features

Auto-detect input format
Bidirectional conversion
Error highlighting

How to Use

1. Paste either YAML or JSON into the input box.

2. Click Convert. The other format appears on the right.

3. Copy or download the result.

About this tool

YAML and JSON describe the same kinds of data — objects, lists, strings, numbers, booleans and null — but YAML uses indentation and is easier to write by hand, while JSON is stricter and easier for programs to exchange. This converter detects which format you pasted and converts it to the other. It handles the YAML found in most configuration files: nested mappings and sequences defined by indentation, quoted and plain scalars, numbers, booleans, null, full-line comments and inline [lists] or {objects}. Converting to JSON is also a quick way to see how a YAML file will actually be interpreted. Advanced YAML features such as anchors, aliases, multi-line block scalars and multiple documents are not supported, so validate those files with a full YAML library.

Frequently Asked Questions

Is YAML a superset of JSON?
YAML 1.2 was designed so that valid JSON is also valid YAML. The reverse is not true: YAML adds comments, anchors, multi-line strings and unquoted text that JSON does not allow.
Why did a value like "no" or "on" change meaning?
Older YAML 1.1 parsers read yes, no, on and off as booleans, which famously turned the country code NO into false. Quote such values ("no") to keep them as strings in any parser.
Why does indentation matter so much in YAML?
Indentation defines which keys belong to which object. Use spaces, never tabs, and keep sibling keys aligned. A single extra space can move a key into the wrong parent.
Which YAML features are not supported here?
Anchors and aliases (&, *), block scalars using | or >, multiple documents separated by ---, and custom tags are not interpreted. For Kubernetes manifests or CI files that use them, validate with a complete parser such as js-yaml or PyYAML.
Are comments preserved when converting YAML to JSON?
No. JSON has no comment syntax, so comments are dropped during conversion. Keep the YAML file as your source of truth if the comments matter.

Related Tools