YAML to JSON Converter
Paste YAML on the left and get equivalent JSON on the right, converted instantly on your device.
Covers standard config-style YAML: nested maps and lists, flow {} and [] syntax, quoted strings, comments, and | and > block scalars. Anchors, aliases and custom tags are not supported. Multi-document files convert the first document only.
Converted on your device — nothing is sent anywhere.
How it works
- Paste your YAML into the input box — the JSON output updates live as you type.
- If the YAML has a problem, read the line-numbered error message and fix the indicated line.
- Copy the JSON to your clipboard or download it as a .json file.
Frequently asked questions
- Which YAML features does this converter support?
- It handles the YAML that real configuration files use: nested mappings and lists by indentation, inline {} and [] flow style, single- and double-quoted strings, comments, and literal (|) and folded (>) block scalars. Exotic features — anchors, aliases, custom tags and complex keys — are not supported and produce a clear error instead of silently wrong output.
- How are YAML types converted to JSON types?
- Unquoted scalars are type-inferred the way YAML defines: true and false become booleans, null and ~ become JSON null, and numeric values including floats, exponents and hex become numbers. Anything quoted stays a string, so “42” in quotes survives as the string 42 rather than a number.
- What happens with multi-document YAML files?
- A file containing several documents separated by --- is converted from the first document only, and a note tells you that the rest was ignored. Split the file at each --- marker and convert the documents one at a time if you need all of them.
- Why does my YAML show an error even though it works elsewhere?
- The most common causes are tabs used for indentation, which YAML forbids, and an unquoted value containing a colon followed by a space, which reads as a nested mapping. The error message includes the line number, and wrapping the offending value in quotes fixes most cases.
- Is my YAML uploaded to a server?
- No. The parser is plain JavaScript running in your browser, so the text never leaves your device. That makes it safe for Kubernetes manifests, CI pipelines or docker-compose files that contain internal hostnames or other details you would not want on a third-party server.
About this tool
This tool converts YAML to pretty-printed JSON as you type. Paste a docker-compose file, a GitHub Actions workflow, a Kubernetes manifest or any application config on the left, and the equivalent JSON appears on the right immediately — no convert button, no page reload. When something is wrong, you get an error that names the exact line and explains the problem in plain English, which is usually faster than the cryptic messages build tools print.
The conversion runs entirely in your browser with a purpose-built parser — nothing is sent to a server, and the page keeps working offline once loaded. The parser covers the YAML subset that configuration files actually use: block mappings and sequences by indentation, inline flow collections like {name: web, port: 8080}, quoted and unquoted scalars with proper type inference, stripped comments, and both literal | and folded > multi-line blocks with their chomping indicators. Anchors, aliases and custom tags are deliberately out of scope; the tool tells you so explicitly rather than guessing.
Typical uses: turning a YAML config into JSON for an API that only accepts JSON, checking what a CI file really parses to before pushing it, converting OpenAPI specs between the two formats, or debugging why a value arrives as a string instead of a number. Because output is standard two-space-indented JSON, it drops straight into package configs, fetch bodies and test fixtures.
Two practical tips. If a value looks wrong in the output, check quoting first — YAML famously turns unquoted no into false and 3.10 into 3.1, and quoting the value in the source is the fix. And if you hit an indentation error, confirm your editor is inserting spaces, not tabs; YAML rejects tab indentation and this converter reports the offending line so you can find it quickly.