FreeConvert1PDF, document and archive tools
Tool index A–Z

JSON to YAML

YAML is easier for people to read and review than JSON: no braces, no commas, indentation that shows the structure. Use this page when settings, a data dictionary or an API definition arrive as JSON but your team keeps such files in YAML.

Choose files
or drop them here
JSON · JSONL · NDJSON · folders work too
Processed on your device: your files are never uploaded.No sign-upNo watermarkNo daily limitNo queue

How to convert JSON to YAML

  1. Pick the JSON file (or a JSON Lines file, which becomes a list).
  2. Choose 2 or 4 spaces of indentation.
  3. Convert and save the .yaml file.

Words YAML could misread

Some YAML readers still follow version 1.1 of the format, where bare words like yes, no, on and off mean true or false. A list of country codes containing NO for Norway can silently become false. Values like these are written in quotes, as are strings that look numeric such as "2.0" or "0042", so the meaning of your JSON is kept everywhere.

The same applies to keys: a one-letter key like y or n is quoted, while normal keys stay bare and readable.

Layout of the result

Objects turn into indented key: value lines, lists into lines starting with a dash, and the key order of the JSON is kept. Long text values stay on one line instead of being folded, so web addresses and access tokens can be copied without reassembly.

The data structure carries over in full. Integers above roughly 15 digits are the exception, because the browser reads JSON numbers as floating point; store such reference numbers as strings if they must survive.

Where the conversion happens

The YAML is produced by js-yaml 5, which the page loads only when you press the button. Your JSON is never sent to our server, worth knowing when it holds passwords, licence keys or internal addresses.

Unlike the Word, Excel and ebook converters on FreeConvert1, which need LibreOffice or calibre on our side, every Data tool on this site works entirely inside the browser.

Questions

Can comments be added automatically?

No. JSON has no comments to carry over. Add any explanations to the YAML by hand.

Is the file uploaded?

No. The js-yaml library runs in the page itself.

Which indentation should I choose?

Two spaces is the most common convention. Use four if the rest of your files use it.