Convert YAML to JSON in your browser
Paste YAML and get clean, pretty-printed JSON. This is handy when a tool wants JSON but your config — a Compose file, a CI workflow, an app settings file — is written in YAML, or when you simply want to inspect the exact data structure your YAML produces.
How it works
The converter is a small recursive-descent parser over indentation levels. It first
tokenizes the input: tabs are expanded to two spaces, blank lines and # comment
lines are dropped, and each remaining line is recorded with its indent depth and trimmed
content. It then walks those lines:
- A run of lines that begin with
-at the same indent becomes a JSON array (block sequence). - Lines of the form
key: valueat the same indent become a JSON object (mapping). - A key with an empty value followed by more-indented lines recurses into a nested block.
Scalars are typed: whole numbers become JSON numbers, decimals become floats,
true/false become booleans, null and ~ become null, an inline [a, b] becomes
an array, and quoted values stay strings. The result is pretty-printed with 2-space JSON
indentation.
Example
Input:
name: Gera Tools
private: true
tools: 6
tags:
- fast
- free
Output:
{
"name": "Gera Tools",
"private": true,
"tools": 6,
"tags": ["fast", "free"]
}
| YAML token | JSON result |
|---|---|
true / false | boolean |
42 | number 42 |
~ or null | null |
"42" | string "42" |
Everything runs locally in your browser — your configuration and secrets are never uploaded or stored, so it is safe for sensitive files.