Paste JSON or YAML, pick a direction and read the other format in the same box. Parsing happens in the browser, comments and the original formatting are not carried over, and errors are reported with the position that caused them.
Runs locally in your browserOne text box converts in both directions. YAML → JSON reads the input as YAML and prints the matching JSON; JSON → YAML reads strict JSON and writes it out as YAML. Those two buttons are the only controls, so the direction is always explicit.
Both parsers ship with the page and run in this tab. Nothing is uploaded, the conversion still works with the network disconnected once the page has loaded, and the text stays on your machine.
JSON → YAML uses the browser’s JSON parser, so the input has to be valid JSON: double-quoted keys, no comments, no trailing commas and no unquoted values. The YAML is written by the YAML 1.2 emitter that ships with the page — two-space indentation, “|-” block scalars for strings that contain line breaks, and quotes only where the value would otherwise change type.
YAML → JSON reads the 1.2 core schema. true and false are booleans, while yes, no, on and off stay text; 0x1F and 0o17 are numbers and 1_000 stays a string; a date such as 2024-01-02 stays the string “2024-01-02” instead of turning into a timestamp. The result is JSON indented with two spaces.
Aliases and merge keys are resolved while reading. A map that shares “base: &b” with “<<: *b” arrives in JSON with the inherited keys written out, so no literal “<<” key is left behind. JSON cannot express anchors, so a round trip gives an ordinary object instead.
Documents separated by “---” are converted one by one, in order. Three documents produce a JSON array with three entries and the status line reports “3 documents”; if one of them cannot be parsed, the message names that document and the result box is emptied.
Repeated keys are treated differently by the two formats: JSON keeps the last value without a word, while YAML input with a duplicate key is refused with a message. Integers outside ±9007199254740991 cannot be stored exactly in JavaScript, so they are rounded to the nearest representable value and the status line reports how many; .inf, -.inf and .nan cannot be written in JSON and become null, also reported.
A parse error clears the previous result instead of leaving it on screen, so an old conversion can never be copied by mistake, and an empty field is answered with a prompt rather than a conversion. Results longer than about 100,000 characters are printed without syntax highlighting: the text is complete, and skipping the colouring is what keeps a several-hundred-kilobyte document from freezing the tab.