YAML ↔ JSON Converter

About the YAML ↔ JSON Converter

YAML and JSON represent the same kinds of structured data — objects, arrays, strings, numbers — but with different syntax. YAML is common in config files (Docker Compose, Kubernetes, CI pipelines) because it's more concise and supports comments, while JSON is the standard for APIs and data interchange.

This tool converts YAML to JSON and JSON to YAML in either direction, so you can move a config or payload between systems that expect one format or the other.

How it works

Common use cases

Frequently asked questions

Why did my YAML → JSON conversion fail?

YAML is whitespace-sensitive — mixed tabs and spaces, or inconsistent indentation between sibling keys, are the most common causes. The error message will usually point to the approximate line where parsing broke.

Does converting JSON to YAML preserve comments?

No — JSON has no concept of comments, so converting JSON to YAML (or YAML to JSON and back) will never generate or preserve comments; any comments in your original YAML are dropped when converting to JSON.

Are YAML anchors and aliases (& and *) supported?

Yes, standard YAML anchors and aliases are resolved during parsing, so the resulting JSON will contain the fully expanded, de-referenced data.

Why do numbers or booleans change format after conversion?

YAML and JSON both support the same core types, so `true`/`false`/numbers convert directly; if a value in your YAML was actually a string (e.g. quoted `"true"`), it will correctly remain a string in the JSON output.

This tool runs entirely in your browser — nothing you enter is sent to a server. Read more in the Privacy Policy, or browse the full list of tools.