JSON to YAML
Convert JSON data into clean, quoted-safe YAML
Indentation is semantics in YAML
Safe quoting, always
Strings that YAML would read as numbers, booleans, dates or "yes/no" get quotes automatically, so the file reloads into the same data every time.
Block style, not JSON-lookalike
Nested objects and arrays become clean indentation-based YAML blocks — far more readable than brace-laden JSON in a config file.
Round-trip guaranteed
Every emission choice is tested to be reversible: the YAML parses back to an identical JavaScript object, so nothing is lost in translation.
✦ What is a JSON to YAML converter?
JSON to YAML reformats structured JSON into the indentation-based YAML syntax used by Docker Compose files, CI workflows and Kubernetes manifests. The engine emits block-style YAML with a selectable 2 or 4 space indent, and its core job is quoting discipline: any string that a YAML parser would misread, such as numbers, dates, booleans, yes and no variants, leading indicators, colons followed by spaces, hashes or stray control characters, is wrapped in single quotes with inner quotes doubled, so the output parses back to the same values.
Config files, pipelines and readable examples
- Drop in an app settings document and receive clean nested mappings and dash-led sequences ready to paste into a compose file or playbook, with empty arrays and empty objects rendered inline as flow markers instead of dangling colons.
- Hand the result to teammates as documentation: mappings inside sequences keep their keys aligned two columns past the dash, which is the classic alignment bug that produces mapping values are not allowed here, and this tool computes absolute columns so it never emits that broken shape.
- Use the sample document to see nesting, lists, numbers, booleans and a URL side by side, then copy the result or download it directly as output.yaml.
Quoting zeal and inputs it turns away
- Strings that merely look like another type are quoted rather than reinterpreted, multiline strings are quoted as well, and non-finite numbers surface as explicit inf markers instead of silently becoming null.
- Empty input and malformed JSON are refused with the parser message shown under the controls, and scalar-only input converts to a single YAML scalar rather than a fake document.
Conversion happens locally in the page with no uploads and no background calls, so private keys inside configs never leave your sight. Nothing you paste is transmitted, stored or logged anywhere off your device.
Last updated · 2026-09-01
Mapping rules and deliberate limits
- Two-space indentation, keys quoted only when YAML would otherwise misread them (the classic trap: a text value of
nobecoming boolean false in YAML 1.1 parsers). - Multiline strings prefer block scalars (
|) over escape soup when line breaks survive round-trips. - Anchors, aliases and custom tags are deliberately not emitted — plain JSON has no equivalent, and inventing them would break re-parsing.
Frequently asked questions
Why are some strings quoted?⌄
Plain YAML resolves bare values by their shape: "true" is boolean, "3.14" is a number, "2026-01-01" is a date. The converter quotes exactly those strings so the YAML loads as the original strings and never silently changes type.
Does every JSON shape convert?⌄
Yes. Objects, arrays, strings, numbers, booleans, null, empty objects and empty arrays all convert. The output follows block YAML (indentation-based) with optional 2- or 4-space indentation.
Is my JSON uploaded anywhere?⌄
No. Everything runs in your browser with plain JavaScript — nothing you paste is transmitted or stored.