JSON to YAML Converter
Paste JSON and get clean YAML that every parser reads the same way, with your comments and key order kept.
Free · No signupConverted in your browser
Valid JSON · 13 keys · depth 3
name: web-api
version: 2.3.0
enabled: true
replicas: 3
ports:
- 80
- 443
resources:
limits:
cpu: 500m
memory: 512Mi
env:
LOG_LEVEL: info
FEATURE_FLAGS:
- new-checkout
- dark-mode
tags: null
Converted in this tab as you type. Nothing you paste or upload leaves this page.
Configs live on servers
Ship the config, manage the servers.
CtrlOps opens the servers your YAML deploys to: edit the file in place with the file manager, run the command, and watch the logs, all over your own SSH keys.
Keep it handy
JSON and YAML,
at a glance.
The same data in two notations: JSON for machines and APIs, YAML for the files people edit by hand.
| Feature | JSON | YAML |
|---|---|---|
| Comments | No | Yes ( # ... ) |
| Syntax | Braces & brackets | Indentation |
| Quotes on keys | Always required | Usually optional |
| Trailing commas | Not allowed | N/A |
| Readability | Medium | High |
| Common use | APIs, config | CI, Kubernetes, config |
How the converter works
Same data.
Easier to read.
What this converter does
JSON and YAML describe the same things, maps, lists and values, so every JSON document has an exact YAML equivalent. The converter reads your JSON, keeps the keys in the order you wrote them, and writes YAML with the indentation you choose. Before showing the result it reads the YAML back and checks it matches your JSON value for value.
Why convert JSON to YAML at all?
YAML is easier to read and edit by hand, which is why Kubernetes, GitHub Actions, Docker Compose and Ansible use it for configuration. Converting a JSON API response, a package.json or an exported config removes the braces and quotes, and lets you add comments once it is a YAML file.
The values that trip YAML readers
Many tools still read YAML 1.1, where on, yes and NO are booleans, 2024-03-01 is a date and 012 is an octal number. Ansible, PyYAML, Ruby and older Kubernetes tooling all do this. So a country code NO left bare becomes false. Every string that could be misread in YAML 1.1 or 1.2 is quoted here; everything else stays bare and easy to read.
Numbers, comments and duplicate keys
Numbers are copied as written, so an ID like 123456789012345678901 keeps every digit, and 1e3 becomes 1.0e+3, the form YAML 1.1 also reads as a number. Files such as tsconfig.json may contain comments and trailing commas; those are read too, and each comment moves to its key as a # comment. A key that appears twice keeps the last value, as JSON.parse does, with a warning, because YAML cannot repeat a key.
Is it safe to paste config here?
Yes. The conversion runs entirely in your browser with no network calls, so it keeps working offline, and nothing you paste, upload or generate leaves the page. It is fine for real manifests, environment files and CI configs.
Check the result in the YAML validatorJSON & YAML FAQ
JSON to YAML,
explained.
Paste your JSON into the left pane. The formatted YAML appears live in the right pane as you type - no button to press. Choose 2 or 4 space indentation, optionally sort keys, then copy or download the YAML. Everything runs in your browser.
Yes. JSON is a strict subset of YAML, so any valid JSON is also valid YAML. That means the conversion never loses information - the YAML this tool produces represents exactly the same data as your JSON.
The YAML specification forbids tab characters for indentation because tabs make structure ambiguous. This converter offers 2-space or 4-space indentation; 2 spaces is the common default used by Kubernetes and most CI systems.
They are quoted automatically. A JSON value like "true", "42", or "null" (as a string) is emitted with quotes in YAML so it is not misread as a boolean, number, or null. This keeps the data identical when the YAML is parsed back.
The most common causes are a missing comma, a single quote instead of a double quote, or an unquoted key. JSON is strict about these. Trailing commas and // or /* */ comments are accepted with a note, because files like tsconfig.json use them, and the comments carry over to the YAML. The tool shows the exact line and column of the error and highlights the offending line so you can fix it quickly.
Yes. A top-level JSON array becomes a YAML sequence (a list of dash-prefixed items), and arrays nested inside objects become indented lists. The structure is preserved exactly.
Yes. The converter runs entirely client-side with no uploads or network calls, which you can verify in the browser network tab, and it works offline. Your JSON never leaves your machine, so it is safe for manifests, .env files, and secrets.
Keep working
Related tools for your next task.