YAML ↔ JSON Converter
Paste YAML or JSON into either pane — the other updates live, with line-numbered parse errors. Runs entirely in your browser; nothing you paste is sent anywhere.
Edit either pane — the other converts automatically. Last edit wins.
About
This converter reads whichever pane you last touched and rewrites the other, on every keystroke, entirely in your browser using the js-yaml library. Nothing is uploaded — there is no server involved in the conversion at all.
The two formats aren't perfectly equivalent, so converting between them is honestly lossy in both directions. YAML comments (anything after #) have no equivalent in JSON and are dropped when you convert to JSON — there's nowhere to put them. YAML anchors and aliases (&name / *name, used to avoid repeating a block) get resolved to their full, repeated values in the JSON output, since JSON has no concept of a reference. Multi-line strings, flow vs. block style, and key ordering hints are all flattened into JSON's plainer shape. Going the other way, JSON's strict quoting is relaxed into YAML's more permissive block style, and long values are kept on one line rather than force-wrapped, so copy-paste round-trips stay intact.
One quiet but useful behavior: YAML dates (like 2024-03-18) parse into real timestamps and come out as ISO-8601 strings in the JSON pane, which is usually what you want when piping YAML config into JSON-consuming tools.
If your YAML has a syntax problem — a stray tab used for indentation, an unterminated flow collection — the error shows up in that pane's footer with the exact line and column, and the other pane keeps whatever it last converted successfully. Multi-document YAML streams (separated by ---) convert only the first document; a note tells you how many were found.