YAML to JSON Converter
Paste indentation-based YAML — maps, lists, and scalars — and get pretty-printed JSON back, with a clear message on malformed input, all in your browser.
{
"name": "calctoo",
"version": 5,
"public": true,
"tags": [
"dev",
"tools"
],
"meta": {
"author": "team",
"stars": null
}
}This handles indentation-based maps, lists, and scalars — the everyday YAML you meet in config files. It doesn't cover anchors, multi-line block strings, or flow style, so exotic files may not round-trip.
How it works
The tool reads your YAML line by line, measuring how far each line is indented. Indentation is how YAML shows nesting, so tracking it lets the parser rebuild the tree: deeper lines belong inside the key or list item above them.
Keys followed by a colon become object properties, dash-prefixed lines become array items, and everything else is treated as a scalar. Values like true, false, null, and numbers are converted to their real JSON types, while quoted strings keep their quotes' contents. The result is printed as JSON with two-space indentation.
It aims at the YAML you actually meet in config files — nested maps, lists, lists of maps, and plain scalars. It doesn't try to handle anchors, multi-line block scalars, or flow syntax, and if a line doesn't fit the expected shape you'll get a message instead of a silent wrong answer.
Frequently asked questions
Which YAML features are supported?
The common ones: indentation-based maps and lists, lists of maps, quoted and unquoted scalars, and the literals true, false, and null. Comments starting with # are ignored. It's built for typical config files, not the full YAML spec.
What isn't supported?
Anchors and aliases, multi-line block scalars (the | and > styles), flow collections written like JSON on one line, and multiple documents in one file. Feed it one of those and the output may not match what a full YAML engine would produce.
Do tabs work for indentation?
Stick to spaces. YAML itself forbids tabs for indentation, and this parser measures leading spaces to work out nesting, so a stray tab can throw the structure off. Most editors insert spaces for YAML by default.