YAML to JSON Converter
Convert YAML files and snippets into valid JSON.
JSON output
Valid JSON
Yes
Keys
7
Max depth
3
{
"name": "Alice",
"age": 30,
"active": true,
"tags": [
"admin",
"editor"
],
"address": {
"city": "New York",
"zip": "10001"
}
}Statistics
- Object keys
- 7
- Arrays
- 1
- Primitive values
- 7
- Max depth
- 3
Conversion runs entirely in your browser — nothing is uploaded. This tool covers the common YAML subset: mappings, sequences, flow styles, quoted strings, comments and block scalars. Anchors/aliases (& and *), tags, and multi-document files are reported as clear errors instead of being silently mis-parsed.
How to use the yaml to json converter
The YAML to JSON converter turns YAML documents into valid JSON instantly. Configuration lives in YAML — Kubernetes manifests, GitHub Actions workflows, Docker Compose files, CI pipelines — but the tools that consume data often expect JSON: APIs, JavaScript applications, scripts, and logs. Paste your YAML, get JSON you can copy, download, or pipe into the next step of your workflow.
Everything runs locally in your browser. Nothing is uploaded or stored, which makes the converter safe for infrastructure configuration, environment values, and internal service definitions.
What the parser understands
The converter covers the YAML you actually meet in real files. Nested mappings expressed by indentation become nested JSON objects. Sequences written with - become JSON arrays — including sequences of mappings, which is how lists of services, steps, and rules are written. Flow styles ([a, b] and {x: 1}) are parsed as their block equivalents.
On the scalar level, quoted strings stay strings, unquoted true/false become booleans, null and ~ become null, and numeric literals become numbers — including floats, exponents, hexadecimal, and octal notation. Comments (#) are stripped, blank lines are ignored, and a leading byte-order mark from Windows editors is handled transparently. Literal and folded block scalars (| and >) work too, since multi-line strings are common in certificates, scripts, and embedded configs.
Errors you can actually use
YAML's flexibility is also its trap: a wrong indent, an unclosed quote, or a duplicate key can change the meaning of a whole document, and the file still "looks fine" to the eye. This parser fails loudly instead of guessing. Every error message includes the line number, and it names the problem specifically — unexpected indentation, unterminated quoted string, a duplicate key, or a mapping line where a value was expected.
Some advanced YAML features are deliberately rejected with clear messages rather than mis-parsed: anchors and aliases (& and *), custom tags (!), YAML directives, and multi-document streams (files with multiple --- sections). If you hit one of these, split the file into single documents first — this keeps every conversion honest, because silently returning wrong data would be worse than refusing.
Pretty or compact output
By default the JSON is pretty-printed with two-space indentation so you can read and verify it before copying. Switch to single-line mode when you need compact output for an HTTP body, a command-line argument, or an environment variable. The result panel reports how many keys and how deep the structure is, which is a quick sanity check that the conversion captured what you expected.
Typical workflows
Platform engineers convert a Kubernetes manifest into JSON to feed a script that inspects resource fields. Developers turn a GitHub Actions workflow into JSON to programmatically list job names. Data engineers convert a YAML pipeline config into JSON for a tool that only speaks JSON. Students and analysts use it simply to see what a YAML file "contains" in a format that is easy to search and diff.
Frequently asked questions
What YAML features are supported?
The common subset used in real configuration files: indented mappings and sequences, sequences of mappings, flow styles, single and double quoted strings, comments, block scalars (| and >), booleans, null, numbers including hex and octal, and BOM/CRLF line endings.
Which YAML features are not supported?
Anchors and aliases (& and *), custom tags (!), directives, and multi-document files. These are reported as clear errors with line numbers rather than being silently mis-parsed, so you never get JSON that quietly means something different.
Why did my quoted version number change?
It should not — quoted strings always stay strings. If a value was written bare (like 1.20), YAML itself defines it as a number, so it converts to a number. Quote such values in the source YAML when they must remain strings, for example version numbers with leading zeros.
How do I fix an indentation error?
The error message names the line number. In YAML, every level of nesting must be indented consistently (2 spaces is the convention) and sibling keys must share the same indentation. Check the reported line first — the problem is almost always one level off.
Is my YAML uploaded anywhere?
No. Parsing happens entirely in your browser. The text is never transmitted or stored, making the tool safe for infrastructure configuration and sensitive values.
Related calculators
View allWhy use CalcFacts?
- Every calculation runs in your browser — nothing is uploaded.
- No signup, no paywall, no email required.
- Clear formulas and breakdowns you can verify yourself.
- Built for speed: results update as you type.