Convert JSON into clean YAML.
The JSON to YAML converter turns a JSON document into block-style YAML. Paste JSON into the left pane and the YAML appears on the right as you type, with a choice of 2 or 4 space indentation. Use it to move configuration between tools that prefer one format or the other.
JSON and YAML describe the same kinds of data: objects (mappings), arrays (sequences) and scalars such as strings, numbers, booleans and null. YAML 1.2 was designed so that valid JSON is also valid YAML, which makes this direction of conversion safe in meaning. The difference is presentation. JSON uses braces, brackets, commas and quoted keys, while YAML block style uses indentation and dashes and quotes strings only when they would otherwise be read as another type or would break the syntax. YAML also supports comments, anchors and multiple documents, none of which exist in JSON, so they never appear when converting from JSON. YAML is common in Kubernetes manifests, CI pipelines and application configuration. This tool parses the JSON with the browser's JSON parser and writes it out with the yaml library.
No meaning is lost, because every JSON value has a YAML equivalent. Only the presentation changes. Numbers larger than 2^53 can lose precision, though, because the browser parses JSON numbers as floating point: 12345678901234567890 comes out as 12345678901234567000.
A plain YAML scalar such as 1.10, true or null would be read as a number, boolean or null. The converter quotes strings that would be misread and leaves ordinary words unquoted.
Yes, use the YAML to JSON tool. Comments are dropped and anchors are expanded on the way back.
Yes, keys are written in the order they appear in the JSON text.
No. YAML does not allow tabs for indentation, so the output always uses spaces.
No. The conversion runs in the page and the text you enter is not sent anywhere.