YAML ↔ JSON Converter
Convert YAML to JSON or JSON back to YAML, entirely in your browser.
Last updated
How to convert YAML to JSON
- Paste your YAML, or JSON to go the other way.
- Click YAML → JSON or JSON → YAML.
- Click Copy result.
What's supported
Conversion uses js-yaml, a complete YAML 1.2 implementation, so everything from simple config files to block text (| and >), flow collections like {a: 1}, anchors and aliases, and quoted strings with escapes converts faithfully. A file with several --- documents becomes a JSON array with one entry per document. YAML 1.2 treats yes, no, on and off as plain strings (only true and false are booleans), which avoids the famous "Norway problem" where the country code NO turned into false. If a conversion fails, the error shows the line and column; the most common cause is a tab in the indentation, which YAML doesn't allow.
JSON → YAML output uses 2-space indentation and quotes strings only when needed (if they could be mistaken for a number, boolean or null, or contain special characters); text with line breaks is written as a | block. Nothing you paste here is uploaded — conversion happens locally in your browser.
Questions about YAML
Why does my YAML fail to convert?
The error shows the line and column. The most common cause is a tab in the indentation; YAML only allows spaces.
What is the Norway problem?
In older YAML, the country code NO was read as false. This converter uses YAML 1.2, where only true and false are booleans, so NO, yes and off stay as text.
Does it support anchors and multi-line text?
Yes. Anchors and aliases, block text with | and >, and flow collections all convert correctly.
What happens to a file with several documents?
A YAML file with several --- documents becomes a JSON array with one entry per document.