YAML to JSON
Parse YAML with js-yaml and emit clean, formatted JSON.Developer ToolsYAML to JSON
Parse YAML with js-yaml and emit formatted JSON. Anchors, merge keys and multi-line strings are resolved per the YAML 1.2 core schema.
About this tool
YAML's indentation rules are too subtle to parse with regex. This tool uses js-yaml — the library behind many CI systems — so anchors, merge keys, multi-line strings and quoted scalars are resolved exactly as a real pipeline would.
How to use the YAML to JSON tool
- Paste your YAML. Any document js-yaml accepts, including anchors and multi-line strings.
- Convert. Parse errors are reported with the line and problem js-yaml found.
- Copy the JSON. The output is formatted with two-space indentation.
Supported formats
Input
- YAML text (1.1/1.2 core schema via js-yaml)
Output
- Formatted JSON
Inputs are validated before anything is processed. Invalid values and unsupported files are rejected with a clear error instead of failing silently.
Frequently asked questions
Which YAML dialect?
js-yaml's default schema, which covers everything GitHub Actions, Docker Compose and Kubernetes manifests use.
Are anchors and aliases resolved?
Yes. &anchors and *aliases are expanded into plain structures before output.
Can YAML execute anything?
No. js-yaml's default schema never instantiates custom tags or code — parsing is pure data.
What about duplicate keys?
js-yaml reports duplicate keys as an error rather than silently keeping the last.
Privacy
Everything you enter stays in this browser tab. There is no upload endpoint for tool inputs, no account, and no server-side copy of your text or files. Results are produced locally and disappear when you close the page.
No account is required and no file is ever uploaded. See the privacy policy for details about analytics and the limited data this site stores.
Known limitations
- No custom tags or binary-typed scalars.
- Documents with tabs in indentation are rejected, as YAML requires.
- Extremely deep nesting may hit the browser's recursion limits.
Related tools
Other free tools from the same collection.