JSON ⇄ YAML Converter

Convert JSON to YAML and YAML back to JSON, right in your browser

Paste JSON to get clean block-style YAML, or paste YAML to get indented JSON, then press the swap button to go the other way. YAML anchors, aliases and merge keys are resolved, comments are dropped, and a mistake in either format is reported with its line and column. Everything runs in your browser: your data is never uploaded, and there is no account to create.

Frequently asked questions

Is my data uploaded anywhere?

No. Converting runs in your browser using JavaScript, so your YAML and JSON are never sent to a remote server and there is no account to create. The page keeps your last input and your settings in your own browser (localStorage) so they survive a reload; nothing is stored anywhere else.

How do I convert in the other direction?

Use the swap button between the two panes. It flips the direction and moves the result into the input, so you can convert JSON to YAML and straight back to check the round trip.

What happens to YAML comments, anchors and aliases?

JSON has no comments, so comments are dropped when you convert YAML to JSON. Anchors (&name), aliases (*name) and merge keys (<<) are expanded into plain values, because JSON cannot reference one value from two places.

Can it read a YAML file with several documents?

No. A file with several documents separated by --- does not map to one JSON value, so the converter reports it as an error. Convert each document on its own.

Will large numbers or values like 1.0 survive?

The converter parses JSON before writing YAML, so a number is written the way JavaScript prints it: 1.0 becomes 1, and an integer beyond 9007199254740991 loses precision. Use the JSON Formatter if you only need to tidy JSON without changing any value.

Is it safe to paste confidential data, such as configuration files with secrets?

Converting never transmits your text, so a confidential file does not leave your machine. You can verify this: open your browser DevTools, switch to the Network tab, and convert something — no request carries your data. Your last input is saved in your browser's localStorage (clear site data to remove it).

Does it cost anything?

No. The converter is free to use with no sign-up and no usage limits.

Turn JSON into code

More JSON tools