YAML / JSON Converter
Convert between YAML and JSON. Free, no signup, runs in your browser.
How It Works
Paste YAML and click the YAML to JSON button, or paste JSON and click the JSON to YAML button. The converted output appears instantly. Use Copy to copy the result to your clipboard.
YAML vs JSON
Both YAML and JSON are data serialization formats. JSON uses braces and brackets and is the standard for APIs. YAML uses indentation and is more human-readable, commonly used for configuration files in Docker, Kubernetes, GitHub Actions, and CI/CD pipelines. Converting between them is a frequent task for developers and DevOps engineers.
YAML vs JSON Compared
| Aspect | YAML | JSON |
|---|---|---|
| Structure | Indentation | Braces and brackets |
| Comments | Yes (#) | No |
| Readability | High | Moderate |
| Common use | Config files, CI/CD | APIs, data exchange |
| Extension | .yaml / .yml | .json |
Common Uses
Developers convert JSON to YAML to make a config file easier to read and edit, and convert YAML to JSON to feed data into an API, a tool, or a script that expects JSON. Both directions are handy when moving Kubernetes manifests, GitHub Actions workflows, Docker Compose files, or API payloads between formats. Because everything runs in your browser, you can convert sensitive configuration without pasting it into an online service.
Frequently Asked Questions
How do I convert YAML to JSON?
Paste your YAML into the input box and click the YAML to JSON button. The converted JSON appears instantly in the output box, formatted with 2-space indentation. Click Copy to copy the result to your clipboard.
How do I convert JSON to YAML?
Paste your JSON into the input box and click the JSON to YAML button. The tool parses the JSON and outputs equivalent YAML with 2-space indentation. Both directions work from the same input box.
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser using the js-yaml library, so your YAML and JSON never leave your device. This makes it safe for config files, secrets, and other sensitive data, and it works even offline once loaded.
Why do I get an invalid YAML or invalid JSON error?
The error means the input could not be parsed. For YAML, check indentation and colons; for JSON, check for missing quotes, trailing commas, or unbalanced braces. The error message includes the details reported by the parser to help you locate the problem.
Does the converter preserve comments?
No. YAML comments are dropped during conversion because JSON has no concept of comments and the data is parsed into a plain structure before being re-serialized. Only keys, values, and structure are preserved.