YAML to JSON Converter

Convert YAML to JSON — or JSON back to YAML — with precise, line-numbered error messages.

Advertisement

Supported YAML subset

This is a hand-written, dependency-free parser covering the YAML you meet in real config files: mappings, nested lists, lists of maps, single/double-quoted and plain strings, integers, floats, booleans (true/false/yes/no), null (null/~), and # comments. Not supported: anchors (&/*), merge keys (<<), and multi-line block scalars (|, >).

Why convert YAML to JSON?

Many APIs and tools only accept JSON, while humans prefer writing YAML. Converting lets you validate a Kubernetes manifest or CI config, then feed it to a JSON-only tool — or go the other way to make a JSON blob human-editable.

FAQ

What YAML features does this parser support?
Mappings, nested lists, lists of maps, quoted and plain strings, integers, floats, booleans (true/false/yes/no), null (~), and # comments. Anchors, multi-line block scalars (| and >), and merge keys are not supported.
How do I find a YAML syntax error?
Paste your YAML and the tool reports the exact line number of the first problem, e.g. "Line 7: Expected key: value". The most common cause is mixing tabs and spaces — YAML requires spaces for indentation.
Can I convert JSON back to YAML?
Yes — switch the direction to JSON → YAML. Nested objects and arrays are emitted with 2-space indentation, and strings that need quoting (containing colons, hashes, or looking like numbers) are quoted automatically.
Is my YAML data sent to a server?
No. Parsing and conversion run entirely in your browser with JavaScript. Your data never leaves your device, so config files with secrets are safe to paste.
Advertisement