Skip to content
DoItJag

YAML to JSON Converter

Turn YAML configuration into JSON for an API, a script or a tool that only reads JSON.

or drop a file here · .yaml, .yml, .txt · up to 20 MB

Options

About the YAML to JSON Converter

YAML is pleasant to write by hand; JSON is what most APIs, scripts and browser code read. This converter parses your YAML and prints the same data as JSON, which is also a quick way to see exactly how a YAML parser understands a tricky file.

When to use it

  • An API or a cloud console wants JSON, but your configuration is kept in YAML.
  • You want to check how a value was read: string, number, boolean or null.

Worked example

After Try an example, press Convert to JSON. The server block becomes an object with “host” as a string, “ports” as an array of two numbers and “tls” as true. The users list becomes an array of two objects, each with a “name” and a “roles” array. The comment at the top is not included, because JSON has no comments.

How values are read

The converter follows YAML 1.2:

  • true and false are booleans; yes, no, on and off stay as text. Older YAML 1.1 tools treat them as booleans, so results can differ.
  • null, ~ and an empty value become null.
  • Numbers become JSON numbers. Integers too long to be held exactly in JavaScript, such as a 20-digit ID, are written with all their digits instead of being rounded.
  • Dates such as 2026-01-01 stay as text.
  • .inf and .nan, which JSON cannot represent, are written as the text “Infinity” and “NaN”.

Anchors, aliases and several documents

Each alias is replaced by a full copy of the anchored value, since JSON has no references. Huge expansions are refused. A file with several documents separated by — becomes a JSON array with one item per document, and the page tells you how many there were.

Good to know

How to use YAML to JSON Converter

  1. Paste YAML or open a .yaml or .yml file.
  2. Choose the indentation of the JSON.
  3. Select Convert to JSON, check the result, then copy or download it.

Privacy: how it works

Everything happens in your browser. Your text is not sent to any server.

Frequently asked questions

Is "yes" turned into true?

No. The converter uses YAML 1.2, where only true and false are booleans. Words such as yes, no, on and off stay as text. Some older YAML 1.1 tools treat them differently.

What happens to anchors and aliases?

Each alias is replaced by a copy of the value it points to, because JSON has no references. To protect your browser, very large alias expansions are refused.

Are comments kept?

No. JSON does not allow comments, so they are left out of the result.