YAML to JSON
Convert YAML configs — including comments, anchors, and aliases — back to structured JSON instantly in your browser.
Anchors & Aliases Resolved
Expands YAML anchors and aliases into their full values, with built-in protection against anchor-bomb style input.
Clear Error Messages
Reports clear, position-aware error messages for malformed YAML.
Local Processing
Your data never leaves your browser. Privacy first conversion.
How to Convert YAML to JSON
- Paste your YAML — application configs, Kubernetes manifests, CI definitions, including ones using anchors and aliases.
- Click Convert.
- Structured, indented JSON appears in the output pane.
- Feed it to anything that speaks JSON: APIs, JSON.parse, jq, schema validators.
Example: Anchors and Aliases, Fully Expanded
Input — YAML with an anchor (&) and aliases (*)
regions: &shared - eu-west-1 - us-east-1 primary: *shared backup: *shared
Output — JSON
{
"regions": [
"eu-west-1",
"us-east-1"
],
"primary": [
"eu-west-1",
"us-east-1"
],
"backup": [
"eu-west-1",
"us-east-1"
]
}JSON has no reference syntax, so each *shared alias is expanded into a full copy of the anchored list — the standard, correct translation.
What YAML features become in JSON
Anchors and aliases expand into copies, comments disappear (JSON has nowhere to put them), and YAML’s unquoted scalars resolve to real types — true becomes a boolean, 3 becomes a number. Converting is a quick way to see what a YAML parser actually understands your config to mean, which is occasionally not what the indentation suggested.
Protected against malicious YAML
Alias expansion is exactly the mechanism behind "billion laughs" YAML bombs — tiny documents that expand into gigabytes. The converter enforces the yaml library’s built-in expansion limits, so a hostile document errors out instead of freezing your tab.
Frequently Asked Questions
Yes — an anchor like &base defines a reusable value, and every *base alias elsewhere in the document is expanded to a full copy of that value in the JSON output, including when anchors are nested inside lists or used multiple times.
They are dropped — JSON has no comment syntax, so there is nowhere for them to go. Both leading (# on their own line) and inline (# after a value) comments are stripped during conversion; only the actual data survives.
Each document is parsed separately and the results are combined into a single JSON array, one entry per document, in order. This is a one-way convenience: converting that array back to YAML (via JSON to YAML) will not reconstruct multiple --- documents, since a JSON array has no way to signal that intent.
No. Parsing and conversion both happen entirely in your browser — nothing you paste here is ever transmitted anywhere.
It is protected against the classic YAML "anchor bomb" (billion-laughs) attack, where a small file defines nested anchors that alias each other exponentially to exhaust memory — the parser caps the number of alias expansions and rejects files that exceed it rather than hanging or crashing the tab. A YAML file with a genuinely circular anchor (referencing itself) is also caught and reported as an error instead of causing an infinite loop.
Related Tools
JSON to YAML
Convert JSON documents to clean, indented YAML.
JSON Formatter
Make messy, minified JSON readable with customizable indentation.
JSON Validator
Check JSON validity with precise line/column errors.
Base64 Decoder
Decode Base64 text back to readable Unicode instantly.
URL Encoder
Safely percent-encode text for use in URLs and query strings.
JSON to XML
Convert JSON into well-formed XML markup.