JSON to YAML Converter

Convert JSON to YAML in your browser, with two-space indentation for nested objects and lists. Risky strings (colons, numbers-as-text) are quoted automatically so the YAML stays valid.

YAML

JSON to YAML

YAML is a human-friendly data format often used for configuration. This tool parses your JSON and re-emits it as YAML, using two-space indentation for nested objects and - for list items. Strings that could be misread (containing colons, spanning lines, or looking like numbers, booleans or null, including YAML 1.1's yes, on and No) are double-quoted so the YAML reads back as exactly the same data.

Conversion happens in your browser, nothing is uploaded.

What this does

This converter turns JSON into YAML, with two-space indentation for nested objects and lists, quoting risky strings so the YAML stays valid.

How to use it

  1. Paste your JSON.
  2. Convert it.
  3. Read the YAML output.
  4. Copy the result.

How it works

Nested objects use two-space indentation and list items start with a dash. A string is left unquoted only when it starts with a letter, uses just letters, digits, spaces and _ . / -, and is not a word YAML reserves (true, null, and the YAML 1.1 forms yes, no, on, off, y, n in any case). Everything else, including multi-line text, is written in double quotes with JSON-style escapes, so it reads back as the same string in YAML 1.1 and 1.2 parsers.

Example

{"name":"A","tags":["x","y"]} becomes a name line and a two-item tags list in YAML.

Last updated .

Frequently asked questions

How are nested objects and lists formatted?

Nested objects use two-space indentation and list items are prefixed with a dash, matching common YAML style.

When are strings quoted?

Any string that a YAML parser could read as something else is double-quoted: text that looks like a number (+1, .5, 0x1F), a boolean or null in YAML 1.1 or 1.2 (True, NULL, yes, on, No), contains punctuation such as a colon or #, spans several lines, or has leading or trailing spaces. The YAML then parses back to exactly the JSON you started with.

Is my JSON uploaded?

No. Parsing and conversion happen entirely in your browser; nothing is sent anywhere.