YAML to JSON Converter
Convert YAML to JSON online. Paste a YAML config or document and get clean JSON instantly â handles nested mappings, sequences, flow collections, and comments, all in your browser.
Features
đ Practical YAML Support
- Nested mappings and sequences via indentation
- Inline flow collections:
[a, b]and{x: 1} - Sequences of mappings (common in Kubernetes, CI configs)
- Comments and quoted strings handled correctly
⥠Privacy-First
- All parsing happens in your browser
- No data ever sent to a server
- Clear errors for inconsistent indentation
- Download or copy the resulting JSON instantly
đ Round-Trip Friendly
- Pairs with our JSON to YAML converter
- Great for Docker Compose, Kubernetes, CI/CD pipelines
- Inspect and validate config-as-code as plain JSON
- Feed the JSON output into any JSON Schema validator
YAML to JSON Guide
YAML is the standard configuration format for Docker Compose, Kubernetes manifests, GitHub Actions, and countless other DevOps tools. Since every valid JSON document is also valid YAML but not the reverse, converting YAML to JSON is a one-way trip that's extremely useful for validating configs, feeding them into JSON-only tools, or diffing two config revisions as structured data instead of text.
Frequently Asked Questions
Does this support the full YAML specification?
It covers the common subset used in real-world configs: mappings, sequences, flow collections, comments, and typed scalars. Advanced features like anchors/aliases (&/*), multi-document streams, and custom tags aren't supported.
How are quoted strings different from plain ones?
Plain (unquoted) scalars are type-inferred â true, 42, and null become their JSON equivalents. Quoted strings ("01234" or 'true') are always kept as literal strings, which matters for values like zip codes or version numbers.
What happens with inconsistent indentation?
YAML's structure is defined entirely by indentation, so a line that doesn't line up with any valid parent level is reported as an error rather than silently guessed at.
Avoiding YAML surprises when converting to JSON
YAML is friendly to write but has a few rules that change the meaning of values without any error. Converting to JSON is a good way to see exactly how a parser reads your file before it reaches Kubernetes, a CI pipeline or your app.
Tips and common pitfalls
- Some parsers that follow YAML 1.1 read unquoted
yes,no,onandoffas booleans. Quote them when you mean text, for example the country code"NO". - Values like
1.10become the number 1.1 and version strings lose their trailing zero. Quote version numbers. - Indentation must use spaces, never tabs, and siblings must line up exactly.
- Anchors (
&) and aliases (*) are expanded, so a JSON result can be much larger than the YAML file.
More questions
Can one YAML file contain several documents?
Yes, documents are separated by ---, as in many Kubernetes manifests. Each document becomes its own JSON value, so convert them one at a time or as an array.
Is every JSON file valid YAML?
Almost always. YAML 1.2 was designed as a superset of JSON, so most YAML parsers read JSON directly.