JSON to YAML
Convert JSON to YAML and YAML to JSON instantly in the browser — with syntax support for nested objects, arrays, and all scalar types.
What is JSON to YAML Conversion?
JSON (JavaScript Object Notation) and YAML (YAML Ain't Markup Language) represent the same data structures in different syntaxes. JSON uses curly braces and explicit quoting; YAML uses indentation and is designed to be more human-readable. Both are widely used for configuration files and API data.
How to Use
- Click JSON → YAML or YAML → JSON tab to choose the conversion direction.
- Paste your input into the left textarea — or click Sample to load an example.
- The converted output appears instantly in the right pane.
- Click Copy to copy the output, or Download to save it as a file.
Supported YAML Features
- Nested objects and arrays (block style)
- All scalar types: strings, numbers, booleans (
true/false),null - Quoted strings for values that would be ambiguous (
"10001","true","null") - Block scalars (
|literal,>folded) - Sequences (arrays) with
-notation - YAML to JSON: standard YAML boolean aliases (
yes/no,on/off) recognized
FAQ
What YAML style does the converter produce?
The converter always produces block style YAML — the most readable format, with each nested level indented by two spaces and arrays using - item notation. Inline/flow style ({key: value}) is not generated.
Are single-quoted strings supported in YAML input?
Yes. The YAML→JSON parser recognizes both single-quoted ('...') and double-quoted ("...") strings, as well as unquoted scalars.
Why are some string values quoted in the YAML output?
Values that would be ambiguous are automatically quoted — for example "10001" (looks like a number), "true" (looks like a boolean), or "null". This ensures the YAML round-trips back to the original JSON correctly.
Does it handle arrays of objects?
Yes. Arrays of objects are formatted as YAML block sequences where the first key of each object appears on the same line as the - dash, and remaining keys are indented to align with it.
What YAML features are not supported?
Anchors and aliases (&anchor, *alias), YAML merge keys (<<:), multi-document streams, and complex mapping keys are not supported. These are uncommon in JSON-equivalent YAML.