Skip to main content

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).

Processed locally in your browser

How to use it

  1. Paste valid JSON into the input box
  2. Choose the indentation and whether to add the document-start marker
  3. Click Convert to YAML
  4. 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

We use cookies to run this site and, with your consent, to understand usage and personalize ads. You can change your choice at any time.