How to convert YAML to JSON
- Paste your YAML into the left box. The JSON appears on the right as you type.
- Fix any errors. If the YAML is invalid, you'll see the line and column of the problem.
- Copy or download the result. Use the swap button to convert the other way, from JSON to YAML.
Safe for config files with secrets
Kubernetes manifests, Docker Compose files and CI pipelines often contain tokens, passwords and internal hostnames. This converter runs entirely in your browser, so nothing you paste is sent to a server or logged.
YAML vs JSON
| Feature | YAML | JSON |
|---|---|---|
| Comments | Yes, with # | No |
| Structure | Indentation | Braces and brackets |
| Quotes | Usually optional | Required for keys and strings |
| Multiple documents | Yes, split by --- | No |
| Best for | Config files people edit | APIs and data machines exchange |
Things that surprise people
- Comments disappear. JSON has no comments, so anything after # is dropped.
- Unquoted values change type.
true,3andnullbecome a boolean, a number and null. Quote them in YAML to keep them as text. - Multiple documents become an array. A file with several
---sections, like many Kubernetes manifests, converts to a JSON array with one item per document. - Tabs aren't allowed. YAML indentation must use spaces. A tab character is the most common cause of errors.
Questions people ask
Is this YAML to JSON converter free?
Yes. It's free with no sign-up and no limit on file size beyond what your browser can handle.
Is my YAML uploaded anywhere?
No. The conversion runs in your browser, so config files and secrets never leave your device.
Can it convert JSON back to YAML?
Yes. Choose JSON → YAML at the top or press the swap button between the two boxes.
Why do I get a YAML error about indentation?
YAML uses spaces for indentation and doesn't allow tabs. Check the line shown in the error and make sure items at the same level line up exactly.
How are multiple YAML documents converted?
If your file contains several documents separated by ---, the JSON output is an array with one item per document.
Are YAML comments kept?
No. JSON doesn't support comments, so they are removed in the JSON output.