YAML ⇄ JSON

Your file never leaves your device — the conversion happens entirely in your browser.

What a conversion destroys, and why we count it

JSON cannot hold a comment, and a YAML file's comments are usually the only documentation it has. Every converter drops them; this one tells you how many died. YAML's anchors (&base / *base) are sharing, and JSON has no references — so they expand into copies, and you are told how many. If an anchor refers to itself, there is no JSON to give you at all: we say that instead of returning something plausible.

Your big numbers survive here

Paste id: 12345678901234567890 into most converters and you get back 12345678901234567000 — a different number, silently. That is JavaScript's floating point, and it eats database IDs and snowflake IDs for breakfast. This tool reads integers exactly and writes the digits you gave it. It is the same discipline our JSON⇄CSV tools use.

No Norway problem

In older YAML (1.1, which PyYAML still speaks), country: NO parses as false — Norway becomes a boolean. This tool reads YAML 1.2, where NO is the string it looks like. Worth knowing in the other direction too: if you feed our YAML output to a 1.1 parser, quote such values yourself. As always, the page is static and keeps working offline, verified by our automated tests on every release.