YAML to JSON Converter
The YAML to JSON Converter turns YAML config files into JSON, and JSON back into YAML, as you type. It shows the line and column of any mistake, resolves anchors and merge keys, and can read YAML the way older YAML 1.1 tools do. Nothing is uploaded.
What is the YAML to JSON Converter?
The YAML to JSON Converter changes data between the two formats developers meet every day. YAML is the indented format of Docker Compose, Kubernetes, GitHub Actions and many app settings; JSON is what APIs, JavaScript and most databases expect. Paste YAML and you get formatted or one-line JSON; switch direction to turn JSON into clean YAML. Anchors, aliases and << merge keys are expanded, several documents separated by --- become a JSON array, and errors point to the exact line. You can also choose to read the YAML as version 1.1, where words like yes, no and on mean true and false. Developers, DevOps engineers, students and anyone editing a config file use it.
Who it is for: Developers, DevOps and cloud engineers, data analysts, students learning config files, and anyone who needs to check or move settings between YAML and JSON.
How to use the YAML to JSON Converter
- Choose YAML to JSON or JSON to YAML.
- Paste your YAML or JSON into the box.
- Choose the indent, and for YAML which version rules to read it with.
- Copy or download the result, or fix the line the error message points to.
Why use it
- Both directionsTurn YAML into JSON, or JSON into YAML, and swap with one button to check a round trip.
- Errors you can findA mistake shows its line and column, such as a tab, a missing colon or a bracket that is never closed.
- Old and new YAML rulesRead files as YAML 1.2 or as YAML 1.1, so you see what tools such as PyYAML will really get.
- PrivateConfig files often hold hostnames and settings. They stay on your device; the converter works offline once loaded.
At a glance
- What you put in
- YAML or JSON text, typed or pasted
- What you get
- JSON (2 spaces, 4 spaces or one line) or YAML (2 or 4 spaces), with a .json or .yaml download
- Limits
- Comments are dropped in JSON; numbers beyond 15 to 16 digits lose precision; custom YAML tags such as !Ref are kept as plain values; no file upload
- Privacy
- Runs in your browser. Nothing you enter is uploaded or stored.
- Price
- Free for everyone. No subscriptions, no payments, no watermark.
- Works offline
- Yes, once the page has loaded
- Last checked
- by AK Shine
Worked example
name: openmultiurl / version: 2 / private: true / tags: [tools, free] / build: with node: "22" and two steps, npm ci and npm run build (YAML to JSON, 2 spaces)
{ "name": "openmultiurl", "version": 2, "private": true, "tags": ["tools", "free"], "build": { "node": "22", "steps": ["npm ci", "npm run build"] } } spread over 16 linesversion: 2 stays a number and true stays a boolean, while "22" stays text because it is in quotes. Without the quotes, node: 22 would become the number 22.
When to use something else
- JSON has no comments, so every # comment in your YAML is lost on the way to JSON and cannot come back. Keep the YAML file as your source if the comments matter.
- For AWS CloudFormation files with !Ref or !GetAtt, use the AWS cfn-flip tool instead: this converter reads those tags as plain values and does not write the Fn:: form.
Questions people ask
Is JSON valid YAML?
Almost always. YAML 1.2 was designed so that JSON is a subset of it, so a YAML 1.2 reader can open a JSON file. The rare exceptions involve odd cases such as duplicate keys or very long keys. This is why JSON to YAML and back gives the same data.
Why did "no" turn into false?
You chose YAML 1.1, where yes, no, on, off, y and n are booleans. That is the old "Norway problem": a country code NO becomes false. YAML 1.2 reads them as text. When this tool writes YAML, it puts quotes around such words so every reader keeps them as text.
What do & and * mean in YAML?
&name marks a block as an anchor and *name repeats it elsewhere, so you write shared settings once. << is a merge key that copies an anchored map into another and lets you override some keys. JSON has no such feature, so the converter writes the values out in full.
Why does my YAML give an error about indentation?
YAML uses spaces to show nesting and does not allow tab characters for indentation. Every item at the same level must start at the same column. The error line shows where the reader got confused; the real mistake is often on the line just above it.
What happens to several documents separated by ---?
Each document becomes one item in a JSON array, in order. A Kubernetes file with a Deployment and a Service, for example, becomes an array of two objects.
Are dates converted?
With YAML 1.2, a date such as 2026-11-24 stays as text. With YAML 1.1, it is read as a timestamp and written in JSON as 2026-11-24T00:00:00.000Z. Put a date in quotes if you want it to stay as text everywhere.
Is the YAML to JSON Converter free and private?
Yes. It is free with no subscriptions, and your files are never uploaded: the conversion uses the open source yaml library inside your browser.