YAML ↔ JSON Converter

Convert between YAML and JSON formats in both directions.

Input

Output

About the YAML ↔ JSON Converter

The YAML to JSON Converter translates in both directions. Paste JSON and get YAML, or paste YAML and get JSON, with the structure and values preserved.

JSON is strict: every key is quoted, every comma matters, and there are no comments. YAML is the human-friendly equivalent, using indentation instead of braces and allowing comments. That makes YAML pleasant to write and easy to break, since a single misplaced space changes the nesting.

Two rules catch people out. YAML forbids tabs for indentation, so use spaces consistently. And unquoted values like yes, no, on and off are read as booleans, which is why a country code of NO becomes false unless it is quoted.

Common questions about YAML to JSON Converter

What is the difference between YAML and JSON?

Both represent the same data structures. JSON uses braces and brackets, YAML uses indentation, and only YAML allows comments.

Can I convert in both directions?

Yes. The tool detects which format you pasted and converts to the other.

Why does my YAML fail?

Usually tabs used for indentation, or inconsistent spacing between levels. YAML requires spaces only.

Are comments preserved?

No. JSON has no comment syntax, so comments are lost when converting to JSON.

Does it support anchors and aliases?

The parser handles common YAML. Advanced features such as anchors, aliases and multi-document streams may not survive.

Why did my value become true or false?

Unquoted yes, no, on and off are YAML booleans. Quote the value if you mean the word.

Related Tools in Developer Tools

JSON FormatterBase64 Encoder/DecoderURL Encoder/Decoder