How to use the YAML to JSON converter
Paste either format and the converted text appears in the output as you type.
- Paste YAML or JSON into the Input box, or press Paste. Try it loads a short YAML example.
- Leave Direction on Auto detect, or force YAML to JSON or JSON to YAML. Auto detect treats text that starts with a brace or square bracket as JSON and everything else as YAML.
- Pick the Indent: 2 spaces, 4 spaces or Tab. YAML may not be indented with tabs, so Tab gives two spaces in YAML output and real tabs in JSON output.
- Check the status line. It shows "YAML → JSON" or "JSON → YAML", or an error such as "Invalid YAML" with a line and column.
- Press Copy or Download .txt. Use as input sends the result back into the input box, which is handy for a round trip.
The work is done by js-yaml 4.1 inside your browser, so deployment settings, URLs and secrets in your YAML are not uploaded. One trap: YAML written in flow style, such as {a: 1, b: [x, y]}, starts with a brace, so Auto detect reads it as JSON and reports an error. Choose YAML to JSON for that kind of input.