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.
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
- Paste your JSON.
- Convert it.
- Read the YAML output.
- 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.
Related tools
Markdown to HTML Converter
Convert Markdown to clean HTML with a live preview: headings, bold and italic, links, images, lists, code blocks, blockquotes and rules. Raw HTML is escaped. Runs in your browser.
CSV to JSON Converter
Convert CSV to JSON in your browser: choose a delimiter, use the first row as a header, and optionally cast numbers and booleans to real JSON types. Quoted fields and commas are handled.
Cron Parser
Decode a cron expression into plain English and see the next five run times. Supports lists, ranges and steps across all five fields. Parsed and scheduled in your browser.
JSON Formatter
Pretty-print, validate and minify JSON, with selectable indentation and optional recursive key sorting. Syntax errors are pinpointed by line and column. Fast and private, all in your browser.