← All tools/Minifiers/Code/YAML to JSON Converter

YAML to JSON Converter

Paste YAML and get JSON, or paste JSON and get YAML back. Everything runs on your device — nothing is uploaded.

Mappings, lists, nesting by indentation, quoted strings, numbers, true/false and null. Anchors, aliases and block scalars (| and >) are not supported — they give a clear error instead of a wrong answer.

Converted JSON

{
  "name": "WhiteUI Shop",
  "price": 99,
  "in_stock": true,
  "tags": [
    "tools",
    "free"
  ],
  "address": {
    "city": "Hyderabad",
    "pincode": 500032
  }
}

YAML lines
10
JSON lines
13
Input lines10
Output lines13
Top-level keys5

How it works

YAML → JSON: parse the YAML into a data structure, then print it as JSON.
JSON → YAML: parse the JSON, then print it as YAML with 2-space indentation.
Supported YAML: mappings, lists, nesting by indentation, quoted strings,
numbers, true/false, null. Not supported: anchors, aliases, block scalars.

Take this YAML — name: shop on one line and price: 99 on the next — and the converter reads two keys, name with the text “shop” and price with the number 99, then prints {“name”: “shop”, “price”: 99}. The default example on the page is a shop configuration with a list of tags and a nested address, and it converts to 13 lines of JSON with 5 top-level keys.

Frequently asked questions

What YAML can this converter handle?

The common subset: mappings (key: value), lists (- item), nesting by indentation, quoted strings, numbers, true/false and null, plus simple flow lists like [1, 2]. It does not handle anchors, aliases, block scalars (| and >) or tabs for indentation — those give a clear error instead of a wrong answer.

Does my YAML leave my browser?

No. The conversion runs entirely on this page with JavaScript — nothing is uploaded, stored or sent anywhere. You can use it on work configs without worrying about the contents leaving your machine.

How do I convert JSON back to YAML?

Switch the direction to “JSON → YAML” above and paste JSON instead. The converter prints YAML with your chosen indent size, quoting any string that would otherwise be read as a number or a boolean.

Why did I get “expected key: value”?

Usually a line that is not indented to match its neighbours, or plain text with no key. Check that nested lines line up under their parent key with spaces (never tabs) and that every line has the form key: value.

More tools

Tell us what you think

Loving this tool, or stuck on something? Tell us — it takes a minute.

We’ll only use your name and email to reply if needed. The tool and page are filled in for you.