YAML to JSON Converter — Free & In Your Browser
Config-file YAML in, strict JSON out — and an instant validity check for free.
🔒 Runs in your browser — files never uploaded ⚡ No signup 💯 Free
Convert YAML to JSON — for the API that wants JSON, the jq pipeline, or just to see what a YAML file actually contains once anchors, multi-line strings and type coercion have done their work. Pretty-printed, two-space indented JSON, produced live in your browser.
It doubles as a YAML validator: if your Kubernetes manifest or CI config has an indentation error, the message points at it — often faster than pushing and watching the pipeline fail.
How to use YAML to JSON
- Paste YAML into the left pane.
- Read the JSON on the right — or the parse error, with a line reference.
- Copy or download as a .json file.
Seeing what YAML really parses to
YAML's conveniences — anchors and aliases, folded and literal block strings, implicit typing — make files concise and their contents non-obvious. Converting to JSON expands all of it: aliases become the repeated data they reference, block strings become plain strings with their real line breaks, and every scalar shows its final type. When a config behaves oddly, this view usually explains why.
The classic surprises
- Unquoted versions:
version: 1.20parses as the number 1.2. Quote it. - Times:
port: 22:22is a sexagesimal-ish surprise in old parsers; modern YAML 1.2 (used here) is saner but quoting anything ambiguous remains the rule. - Tabs: YAML forbids tab indentation — a stray tab from an editor is the most common "but it looks fine" failure.
Multiple documents
A file with --- separators contains several YAML documents; this converter reads the first. Split multi-doc manifests before converting, or convert each section separately.
Related
Mirror direction: JSON to YAML. To reformat the JSON further, the JSON formatter.
Frequently asked questions
Can I use this to validate YAML?
Yes — that's half its value. If the YAML parses, you get JSON; if not, you get the parser's error with a line reference. For CI configs and Kubernetes manifests that's a faster loop than push-and-wait.
What happens to anchors and aliases?
They're expanded: an alias becomes a full copy of the anchored data, because JSON has no reference mechanism. The output can therefore be larger than the input — that's the aliases doing their job in reverse.
Why did my version number change from 1.20 to 1.2?
Because unquoted 1.20 is a YAML number, and numbers don't keep trailing zeros. This is YAML's single most common gotcha — quote version strings in the source: version: "1.20".
My file has --- separators — why only part of it converts?
--- starts a new YAML document, and JSON has no multi-document equivalent, so the first document is converted. Split the file at the separators and convert each part.