YAML to JSON Converter
Paste YAML and get clean, formatted JSON instantly — including multi-document files and anchors.
🔒 Your data never leaves your browser — all conversion happens locally.
How to use the yaml to json converter
- Paste your YAML into the left panel — a working multi-document example is preloaded.
- Toggle pretty-print and key-sorting as needed.
- Read the converted JSON on the right, updated live as you type.
- Click "Copy output" to grab the result.
How it works
This converter uses js-yaml, a full YAML parser, so it correctly handles indentation, quoting, dates, and other YAML-specific syntax that regex-based converters get wrong. YAML anchors (&name) and aliases (*name) are resolved automatically into their referenced values. If your input contains multiple documents separated by ---, the output becomes a JSON array with one entry per document; a single document converts to a single JSON object.
Examples
| Input | Result |
|---|---|
| title: Reminder\ndue: 2026-08-01 | {"title":"Reminder","due":"2026-08-01T00:00:00.000Z"} |
| doc1\n---\ndoc2 (two documents) | [doc1, doc2] as a JSON array |
Frequently asked questions
Is my YAML uploaded anywhere?
No — parsing happens entirely in your browser. Nothing is sent to a server.
Does this support multiple YAML documents in one file?
Yes. If your input has more than one document separated by "---", the output is a JSON array with one entry per document.
Are YAML anchors and aliases resolved?
Yes — anchors (&name) and their aliases (*name) are automatically expanded to their full values in the JSON output.
How are YAML dates and booleans handled?
They're parsed into native JavaScript dates and booleans automatically, matching standard YAML 1.2 type resolution.
What happens if my YAML is invalid?
You get the exact YAMLException message, including the line and column of the problem, instead of a silent failure.