JSON ↔ YAML

All tools

How to convert JSON to YAML and back

Move configuration between JSON and YAML. Avoid aliases, custom tags and duplicate keys in the YAML input.

Steps

Paste the input into the form and choose a mode if one is offered. Check the result before copying or saving it.

Use this tool: JSON ↔ YAML

Example

{"enabled":true} → enabled: true
{"count":3} → count: 3

What to check

Check whether product codes, dates and yes/no values are still strings where the receiving application expects them. YAML comments do not carry over to JSON.

Common tasks and examples

Start with a small sample. Compare the structure before and after a format conversion, or check that only the intended characters changed in a text operation.

  • {"flag":false} → flag: false
  • count: 2 → {"count":2}
  • {"items":[1,2]} → items: [1, 2]

Task reference

JSON → YAML
Settings: Input: {"enabled":true} · What to expect: YAML · enabled: true
YAML → JSON
Settings: Input: enabled: false · What to expect: JSON · {"enabled":false}
JSON → YAML
Settings: Input: {"items":[1,2]} · What to expect: YAML · items
YAML → JSON
Settings: Input: count: 2 · What to expect: JSON · {"count":2}
YAML → JSON
Settings: Input: item: null · What to expect: JSON · {"item":null}

More tools