YAML to JSON Converter NZ
This tool converts YAML into JSON, turning the clean, indentation-based configuration format into the structured format that programs and APIs consume. YAML and JSON describe the same kinds of data, objects, lists and values, but they look very different. YAML is designed for humans, using indentation and minimal punctuation, which makes it the format of choice for configuration files in tools like Docker, Kubernetes and CI pipelines. JSON is designed for machines, with explicit braces, brackets and quotes, and is what most code and web APIs expect. Moving from YAML to JSON is a routine task whenever a human-edited config needs to be fed to a program, and doing it by hand is error-prone. This converter does it instantly. You paste your YAML, and the calculator parses the indentation, the key-value pairs and the dashed lists, then produces the equivalent JSON, neatly formatted. The result updates as you type and runs entirely in your browser, so your data is never uploaded. Use it to turn a config file into JSON, to feed YAML data to a program or API, to learn how the two formats correspond, or for development work. The converter understands the common YAML constructs: nested objects shown by indentation, lists written with dashes, and scalar values, automatically recognising numbers, booleans and null so they become the right JSON types rather than strings. This complements the JSON to YAML converter for the reverse direction. A note on scope: YAML is a rich format with advanced features like anchors, multi-line block scalars and flow style, which this converter does not fully support; it handles the everyday indentation-based maps, lists and scalars that make up the vast majority of real configuration files. For those, it gives you clean, correct JSON in a moment, ready to drop into your code.
Handles indentation-based maps, dashed lists and scalars (numbers, booleans, null recognised). Advanced YAML (anchors, block scalars) is not supported. Runs in your browser.
How it works
The converter reads the YAML line by line, using the indentation to track nesting. Lines with a key and value become object properties, lines starting with a dash become list items, and deeper indentation creates nested objects or lists. Scalar values are typed: numbers, true, false and null are recognised, and everything else is treated as a string.
Worked example
Pasting YAML with a name, a tools list of two dashed items, an active flag and a count converts to a JSON object: name as a string, tools as an array of two strings, active as the boolean true, and count as the number 779, all with proper braces, brackets and quotes ready for code.
Related calculators
- JSON to YAML: the reverse.
- JSON Formatter: format JSON.
- CSV to JSON: CSV conversion.
- JSON to Query String: query strings.