JSON to YAML
Convert between JSON and YAML in both directions.
OUTPUT:
// A worked conversion
IN
{"name":"John","age":30,"tags":["dev","ops"]}
OUT
name: John age: 30 tags: - dev - ops
Arrays become dash lists and scalar types are preserved. The converter also adds a trailing newline to the YAML output.
// Options and parsing notes
- >[JSON → YAML] — Requires strict JSON. JSON.parse runs first, then the yaml library writes the value with the chosen indent.
- >[YAML → JSON] — Parses YAML and writes standard JSON with the same indent setting.
- >2 spaces / 4 spaces — Controls indentation in both directions. Editing the input clears the old result; click a direction button to convert again.
- >[SWAP] — Moves the output back into INPUT, which is handy for converting it back the other way.
- >YAML 1.2 scalars — Words such as yes, no, on and off are parsed as strings, not booleans.
- >Processing — Both conversions run in this browser tab. The page sends no request containing your data.
// Where to go next
- >JSON Formatter — read the converted JSON as a tree or edit a value in place
- >JSON Diff — compare the converted file with an earlier version