JSON to YAML Converter
JSON to YAML Converter takes valid JSON that you paste and produces a YAML representation of the same data, entirely in your browser.
Converts valid JSON to YAML locally in your browser. Objects, arrays and primitives are supported, including a top-level primitive. Strings that a YAML parser could read as a boolean, number, null or date are quoted so the value stays a string. JSON has no comments, so none are produced, and invalid JSON is reported rather than fixed. YAML output formatting may differ while representing the same JSON data. This is different from the JSON Formatter (which formats JSON), the JSON Diff tool (which compares JSON) and JSON to CSV (which flattens JSON into a table).
How to use it
- Paste valid JSON into the input box
- Choose the indentation and whether to add the document-start marker
- Click Convert to YAML
- Review the YAML output and character counts, then copy the YAML
It accepts objects, arrays, and top-level primitives — a string, finite number, boolean, or null on its own. Strings that a YAML parser could read as a boolean, number, null, or date — such as "yes", "00123", "1e3", or "2026-08-31" — are quoted so they stay strings. Nested structures, Unicode text, and strings that contain newlines are all handled; multi-line strings use YAML block scalars. You can choose 2- or 4-space indentation and optionally add the YAML document-start marker (---). The parsed object's key order is kept as JavaScript represents it, and keys are never sorted. Nothing is uploaded or stored. Invalid JSON is reported rather than auto-corrected, and because JSON has no comments, none are produced. It is different from the JSON Formatter, which formats and validates JSON, the JSON Diff tool, which compares two JSON documents, and JSON to CSV, which flattens JSON into a table. A future YAML to JSON tool will cover the other direction; this tool only serializes JSON into YAML.
FAQ
Any valid JSON: objects, arrays, strings, finite numbers, booleans, and null. A top-level primitive on its own, such as 42 or "hello", is also accepted and converted.
Yes. Values that a YAML parser might otherwise read as a number, boolean, null, or date are quoted in the output, so "00123", "yes", and "2026-08-31" all remain strings.
No. The input must be strict JSON. Single quotes, trailing commas, comments, NaN, Infinity, and bare keys are rejected with a message rather than silently corrected.
JSON has no comments, so there are none to carry over. The converter also does not add any comments of its own to the YAML output.
No. The JSON is parsed and serialized to YAML in your browser. The input, the YAML output, and your options are never sent to a server or saved.