Convert YAML to JSON with a safe parser — anchors and merge keys expanded, no code execution, errors reported with line and column. Ideal for debugging configs as JSON.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
YAML detangled into JSON
YAML is pleasant to write and tricky to reason about — anchors, aliases, merge keys, implicit typing. Converting to JSON flattens all of that into plain, explicit data: aliases expand, merge keys resolve, and what you see is literally what a program would get. Parsing uses js-yaml’s safe schema: no custom tags, no code execution, so pasting untrusted YAML is safe — and it never leaves your browser anyway.
Worked example
defaults: &base
retries: 2
job:
<<: *base
name: nightly-syncbecomes:
{
"defaults": { "retries": 2 },
"job": { "retries": 2, "name": "nightly-sync" }
}When to use it
- Debugging a manifest by seeing exactly what the parser sees.
- Feeding YAML-authored config into JSON-only tooling.
- Checking what an anchor/merge-key construction actually resolves to.
Limitations to know
- One document per run — files with — separators are rejected with a clear message instead of silently dropping documents.
- YAML implicit typing has sharp edges: unquoted
noor1.20may not be the type you meant. When a value must be a string, quote it in the YAML source.
Common errors and fixes
- “Invalid YAML (line X, column Y)” — usually indentation: YAML nesting is whitespace-based and tabs are not allowed for indentation.
- Validate the result — run the output through the JSON Validator or explore it in the JSON Viewer.
How to use the YAML to JSON Converter
- Paste YAML into the input panel.
- Click "Convert to JSON".
- Anchors, aliases and merge keys are expanded automatically.
- Pick the output indent and copy the JSON.
Frequently asked questions
Is it safe to paste untrusted YAML here?
Yes on two counts: parsing uses js-yaml's safe schema (no custom tags, no code execution — the historic YAML deserialization attacks do not apply), and everything runs locally in your browser with no upload.
What happens to anchors (&) and aliases (*)?
They expand into plain values — JSON has no reference syntax, so shared nodes get duplicated. Merge keys (<<:) resolve the same way. The output is semantically identical, just denormalized; a warning notes when this happened.
Why did my value come out as a string/boolean unexpectedly?
YAML's implicit typing: unquoted yes/no/on/off can read as booleans in older YAML 1.1 tools, version-like values (1.20) as numbers, and 03:10 as odd things. When a value must be a string, quote it in the YAML source.
Can I convert multiple YAML documents at once?
One document per run — a file with — separators is rejected with a clear message rather than silently dropping documents. Split and convert each.