How to Convert JSON to YAML in Your Browser
Paste valid JSON into the input
Drop your JSON object or array into the JSON Input box. The converter parses it with the browser's native JSON parser, so the text must be strict JSON: double-quoted keys, no trailing commas, and no comments. If parsing fails, the input is highlighted and the exact error message is shown.
Click Convert to YAML
The tool generates clean block-style YAML using two-space indentation. Strings, numbers, booleans, null, nested objects, and arrays are all mapped to their YAML equivalents. Conversion runs entirely on your device, so nothing is uploaded.
Copy or reuse the output
Use Copy YAML to place the result on your clipboard, then paste it into a config file, a Kubernetes manifest, or a CI pipeline. Click Clear to reset both panes and start a new conversion.
How JSON Types Map to YAML
YAML is a superset of JSON, so every valid JSON value has a direct YAML representation. The table below shows how each JSON type appears in the converted output produced by this tool.
| JSON value | Example input | YAML output |
|---|---|---|
| Object | {"host": "db"} | host: db (key and value on one line) |
| Array | ["a", "b"] | Dash list, one item per line with a leading hyphen |
| String | "hello" | hello, quoted only when needed for safety |
| Number | 3.14 | 3.14, written as a bare scalar |
| Boolean | true | true, lowercase literal |
| Null | null | null, the YAML null scalar |
When JSON to YAML Conversion Helps
Kubernetes manifests
Many tools and APIs emit JSON, but Kubernetes manifests are usually authored in YAML. Convert the JSON to YAML to get a manifest that is easier to read, comment, and review in pull requests.
CI/CD pipelines
GitHub Actions, GitLab CI, and similar systems use YAML configuration. If you hold pipeline settings as JSON in code, this converter gives you a clean YAML version to paste into the workflow file.
Docker Compose and Ansible
Compose files and Ansible playbooks are YAML based. Turning generated JSON into YAML lets you reuse existing data structures in these infrastructure-as-code tools without retyping them.
Readable config for humans
YAML drops the braces and commas that make nested JSON hard to scan. Convert when you want a configuration format that is friendlier to read and edit by hand.
Common Problems and Fixes
Invalid JSON error
The converter uses strict JSON parsing. Remove trailing commas, replace single quotes with double quotes, quote every object key, and delete any comments. The status message names the position or reason the parser rejected the input.
Output is missing comments
JSON has no comment syntax, so there are no comments to carry over into the YAML. Add any explanatory comments to the YAML output yourself after conversion, using the hash character.
Strings appear quoted in the YAML
Values such as yes, no, on, off, or text that looks like a number are quoted automatically so they keep their original string meaning. This is correct behavior and prevents YAML from reinterpreting them as booleans or numbers.
Nothing happens or library not loaded
Conversion needs the YAML library to finish loading. If you see a message that the library is not loaded, check your connection and reload the page, then click Convert again.