Send feedback

Coming from the page: YAML to JSON Converter

One moment…

Both directionsErrors by line & columnNo upload

YAML to JSON Converter

Config files like docker-compose and OpenAPI: switch them between YAML and JSON in seconds.

Everything runs in your browser: no text or file is uploaded to any server.

How to convert

1

Pick a direction

“YAML → JSON” or the reverse. Opening a .json file picks the direction for you.

2

Paste or open a file

The result appears at once; if the YAML has an error you get the line, column and reason.

3

Copy or download

Copy the result or download it as .json or .yaml.

YAML 1.1 vs 1.2

Older tools such as PyYAML read YAML 1.1, newer ones 1.2, and they differ on values like:

ValueYAML 1.2YAML 1.1
yes / no / on / offtexttrue / false
0777777 (decimal)511 (octal)
0o777511text
1:30text90 (base 60)

Good to know

Safe text when writing YAML. Any text a YAML reader might take as a number or boolean, like “yes”, “0501234567” or “1e3”, is written in quotes so it stays text in every version.

Anchors and merges. Anchors &anchor, aliases *alias and merge keys << are expanded into full values in JSON.

Safe from malicious files. The number of aliases is limited, so a “Billion Laughs” file can’t freeze your page.

FAQ

What’s the difference between YAML and JSON?

Both store the same data. YAML is easier to read and write by hand (indentation instead of brackets, # comments); JSON is stricter and faster for programs. Almost any valid JSON is also valid YAML.

Why do I get an indentation error?

YAML relies on spaces: items on one level start in the same column, and tabs aren’t allowed. Check the line and column in the message.

What happens to comments?

JSON has no comments, so they are dropped when converting YAML to JSON.

My file has several documents separated by ---.

They become a JSON array, one item per document.

Is my file uploaded?

No. Conversion happens in your browser; your file never leaves your device.