YAML to JSON Converter
Convert YAML to JSON free in your browser — paste YAML or upload a .yaml file and get clean JSON instantly, with no signup and no upload. Multi-document files and Kubernetes manifests convert to a JSON array, anchors and aliases resolve automatically, and you can switch direction to convert JSON back to YAML on the same page.
YAML to JSON Converter
Paste YAML or upload a file and get clean JSON instantly. Free, private, no signup.
Paste YAML and press Convert.
100% private — parsing runs in your browser with the js-yaml library. Nothing you paste or upload is sent to a server, so Kubernetes manifests, CI/CD configs and secrets stay on your device.
How to use the YAML to JSON Converter
- Paste YAML (or JSON, after switching direction) or upload a file.
- Pick the JSON indent.
- Click Convert.
- Copy or download the result.
How to convert YAML to JSON online
Converting YAML to JSON here takes seconds and needs nothing installed. Paste your YAML into the input box, or upload a .yaml or .yml file, and the tool parses it in your browser with js-yaml, the reference YAML 1.2 parser for JavaScript. Click Convert and the JSON appears below, formatted with your chosen indent — two spaces, four spaces or minified to a single line. If you need the keys in alphabetical order, tick Sort keys alphabetically before converting; the data stays the same, only the order changes. The direction switch at the top of the tool reverses the flow: choose JSON → YAML, paste JSON, and the same page hands you YAML back, with the multi-document checkbox turning a JSON array into separate YAML documents joined by — separators. Because everything runs locally, there is no upload, no queue and no waiting for a server round trip, and large files convert as fast as your browser can parse them. If the YAML is invalid, the error box tells you the exact line and column and shows the offending line, so you can fix the indentation or the stray character and convert again. If the JSON needs a further tidy-up, paste it into our JSON Formatter. When the result looks right, copy it to the clipboard or download it — as a .json file in YAML → JSON mode or a .yaml file in JSON → YAML mode — and drop it straight into your project.
Multi-document YAML and Kubernetes manifests
YAML files often contain more than one document. Kubernetes manifests are the best-known example: a single file can hold a Deployment, a Service and a ConfigMap, each separated by a line containing three dashes, and Helm charts and CI pipelines produce the same multi-document shape. Paste the whole file into the converter and each document is detected automatically — the JSON output becomes an array with one element per document, in the same order they appear in the file, so the Deployment is element zero, the Service is element one, and so on. That array is easy to work with in code: filter it, map over it, or hand it to a script that applies each resource in turn. The same idea works for any multi-document YAML, from docker-compose overrides to GitHub Actions workflow bundles. Going the other way is just as simple. Paste a JSON array, switch the direction to JSON → YAML, tick Multi-document output, and each element is written out as its own YAML document joined by — separators, ready to save as a .yaml file and apply with kubectl. Round-tripping a manifest this way is a handy way to inspect, edit or generate Kubernetes resources without touching the cluster, and because nothing is uploaded, manifests that contain secrets stay on your machine.
YAML anchors, aliases and the YAML 1.1 trap
YAML has a feature JSON lacks: anchors and aliases. You can mark a block with an anchor, such as defaults: &defaults, and reuse it elsewhere with an alias, *defaults, or merge it into another mapping with the merge key <<: *defaults. This converter resolves all three during parsing, so the JSON shows the full expanded values — the merged keys appear in place, exactly as if you had typed them out. That makes the tool useful for checking that a DRY configuration actually expands the way you expect before it reaches production. There is one trap worth knowing about, and it comes from the difference between YAML 1.1 and YAML 1.2. Older YAML 1.1 readers, including PyYAML, treat the words on, yes and no as booleans, while YAML 1.2 — the version this tool’s parser follows — keeps them as plain strings. A value like enabled: on therefore means the string “on” here but true in a Python script, which is a classic source of configuration bugs. The fix is simple: quote ambiguous values, writing enabled: “on” or mode: “yes”, so every parser agrees. Numbers, dates and nulls follow YAML 1.2 rules too, and quoting anything that looks like a number but should stay a string, such as a version “1.10”, avoids surprises on the other side.
Why convert YAML to JSON in your browser
YAML files are where applications keep their secrets. A Kubernetes manifest can hold database passwords, a CI configuration can contain deployment tokens, and an application config can list API keys — the kind of data that should never be pasted into a website that uploads it to a server. This converter parses everything locally in your browser with the js-yaml library, so your YAML never leaves your device and there is nothing for a server log to record. There is no signup, no account and no usage limit, and the page keeps working offline once it has loaded. Compared with command-line tools, the trade is convenience: you get anchors, merge keys, multi-document files and JSON output without installing Python, Ruby or Node, and without learning a new command. If you work with XML as well, our XML to JSON Converter handles that format the same private way. The tool is deliberately narrow — it converts between YAML and JSON and does nothing else — which keeps the interface simple and the result predictable. Paste your configuration, check the output, copy it or download it, and close the tab knowing the contents never travelled anywhere.
Try more free Web Tools: JSON Formatter and XML to JSON Converter.
Frequently asked questions
Yes, free forever, no signup, no limits.
Paste the whole file — documents separated by — are detected automatically and the JSON output becomes an array with one element per document, in source order.
Yes. Anchors (&name), aliases (*name) and merge keys (<<: *name) are resolved during parsing, so the JSON shows the full expanded values.
No. Parsing runs in your browser with js-yaml, so manifests, CI/CD configs and secrets never leave your device.