Tools › Developer tools

YAML to JSON converter

Convert YAML to JSON and JSON to YAML online. Anchors, merge keys and multi-document files work; errors name the line and column. Nothing is uploaded.

✓ Converted

How it works

  1. Paste YAML or JSON, or drop a .yaml, .yml or .json file. The result updates as you type.
  2. YAML is read with js-yaml using the YAML 1.2 core schema plus merge keys, so anchors, aliases and <<: *defaults in Docker Compose or CI files are expanded. Dates stay strings, exactly as written.
  3. JSON to YAML writes block style and quotes strings that a YAML reader could take for a number, boolean or date, such as "1.0", "no" or "2024-05-01".

Questions

Is my file uploaded?

No. The conversion runs in this browser tab, and the page has no server to send it to. Config files with secrets stay on your device.

What happens to several documents separated by ---?

They become one JSON array with one item per document. The page tells you when that happens.

Are YAML comments kept?

No. JSON has no comments, so they are dropped when converting to JSON and cannot come back in the other direction.

Why is a duplicate key an error?

The YAML specification requires keys in a mapping to be unique. Instead of silently keeping one of the values, the converter stops and shows the line.

Are very large numbers exact?

Integers above 9,007,199,254,740,991 (2^53 − 1) are rounded, as in any JavaScript JSON parser. Keep such IDs as quoted strings.