JSON ↔ YAML Converter

Convert between JSON and YAML.

Free. Runs in your browser: nothing you enter or open is uploaded.

YAML

Converted in your browser with js-yaml (MIT licence). YAML comments, anchors and custom tags have no JSON equivalent, so comments are dropped and anchors are written out in full. A YAML file with several documents separated by --- becomes a JSON array.

How to use it

  1. Pick the direction: JSON to YAML or YAML to JSON.
  2. Paste your data. The conversion updates as you type and points to the line of any error.
  3. Copy or download the result, or press Swap to convert it back.

Questions

Is every JSON file valid YAML?

Almost. YAML 1.2 was designed as a superset of JSON, so JSON can be read as YAML. Converting to proper YAML style just makes it shorter and easier to read.

Why did a value like no or 1.10 change?

YAML guesses types for unquoted values. This converter follows YAML 1.2, where only true and false are booleans, but tools built on the older YAML 1.1 read yes and no as booleans too. Quote values you need kept as text.

What happens to YAML comments?

JSON has no comments, so they are dropped when converting to JSON and cannot come back on the way to YAML.

Is my data uploaded?

No. The conversion runs in your browser, which matters for configuration files that hold hostnames or keys.