YAML

YAML to JSON Converter

Converts YAML to JSON, and points out the type surprises that conversion exposes.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the configuration you want as JSON.
  2. Select Convert to JSON.
  3. Read the types in the output: anything that should be a string and came out as a number or a boolean needs quoting in the original.

What yaml to json does

YAML is a superset of JSON, so this direction always works in principle. What it exposes is how much guessing YAML does about types. An unquoted value is a number if it looks like one, a boolean if it is any of true, yes, on or their variants, and null if it is a tilde or empty. Once it is JSON those guesses are locked in and visible.

That is exactly why the conversion is worth doing before you debug a configuration problem. A version pinned as 1.10 becomes the number 1.1, a country code of NO becomes false, and a build number of 0800 becomes 800. Each of those has caused a real outage somewhere. Converting to JSON shows you the values as your loader will actually see them.

Frequently asked questions

Because YAML read it as a number. An unquoted 1.10 is the number 1.1, and once it is JSON that is what it stays. The same happens to 0800, which becomes 800. Quote any value that is an identifier rather than a quantity.

YAML treats no, n, off and false — in several capitalisations — as boolean false, and yes, y, on and true as boolean true. So a Norway country code of NO becomes false. This is the single most useful thing converting to JSON shows you, and the fix is to quote the value.

They are gone, because JSON has no comment syntax at all. If you need the notes to survive, keep the YAML as the source of truth and generate the JSON from it rather than the other way round.