YAML to JSON

Paste YAML and get formatted JSON. Anchors, aliases and merge keys are resolved, block text keeps its line breaks, and mistakes are reported with the exact line and column.

Free and private. Everything runs in your browser, nothing is uploaded.

How it works

  1. Paste or open a filePaste your data into the input box or open a file. Sample shows an example.
  2. Check the resultThe converted data appears on the right as you type. Errors show the line and column.
  3. Copy, download or swapCopy the result, save it as a file, or press Swap to convert it back.

Check a YAML file before you deploy it

Converting YAML to JSON is the fastest way to see how a program will really read your file. An indentation mistake that moves a key into the wrong block, a duplicate key, a tab used for indentation or an unclosed quote are reported with the line and column, and the line is shown with a marker.

Values are typed by YAML 1.2 rules: 1.0 and 10 are numbers, true and false are booleans, null and ~ are null, and dates stay as text. Unknown tags such as !Ref or !Sub from CloudFormation are kept as plain values and listed above the result, so you can see what was ignored. Very large whole numbers are written exactly, without rounding.

About YAML

YAML is a text format for data that people read and write, based on indentation instead of brackets. It is used for configuration files and supports comments, multi line text and references to repeated parts.

About JSON

JSON (JavaScript Object Notation) writes data as objects in curly braces, lists in square brackets, text in double quotes, numbers, true, false and null. Almost every API and programming language reads it.

Frequently asked questions

Why do I get an error about indentation?

In YAML, the indentation decides which block a key belongs to. All keys of one block must start in the same column, and tabs are not allowed for indentation. The error shows the first line where this breaks.

Is my data uploaded?

No. The conversion runs in your browser. Configuration files with passwords or keys never leave your device.

Why is yes still text in my JSON?

In YAML 1.2, the current version, only true and false are booleans. Older YAML 1.1 tools also read yes, no, on and off as booleans. Turn on the YAML 1.1 option if your file was written for such a tool.

What happens with several YAML documents?

If the input has more than one document, each starting with a line of three hyphens, the JSON result is a list with one item per document.

How are XML attributes shown in JSON?

Attributes get an @ in front of their name, for example @id. If an element has attributes and text, the text goes into #text. You can choose another prefix for attributes.

Does it work offline?

Yes. After you open the page once, it keeps working without an internet connection.