Paste or upload JSON
Add a JSON object, array, or config payload into the input panel. Use the sample button to load realistic service config data.
Convert JSON objects, arrays, and configuration data to clean YAML instantly, or switch directions and convert YAML back to JSON. Choose indentation, quote strings when needed, sort keys for stable diffs, and download a ready to use YAML file. Everything runs locally in your browser.
Since YAML 1.2 the specification states that every valid JSON document is also a valid YAML document. Paste raw JSON into a YAML parser and it will accept it. That fact makes this conversion less of a translation and more of a reformatting: the data model on both sides is the same set of maps, sequences, and scalars, and only the syntax changes.
What you gain is readability and comments. What you gain in risk is whitespace sensitivity and a set of implicit typing rules that surprise people. The rest of this page is about both.
A deployment configuration, first as JSON and then as the block style YAML the converter produces.
JSON input
YAML output
Every brace, bracket, comma, and quotation mark is gone. The structure is now carried entirely by indentation and by the hyphen that marks a sequence item.
Configure your editor to show whitespace and to insert spaces rather than tabs before you edit YAML by hand. It removes an entire category of bug.
YAML supports two ways of writing collections. Block style uses indentation and is the readable default. Flow style uses braces and brackets and looks exactly like JSON, which is why the superset claim holds.
Same value, both styles
Flow style is useful for short lists where a vertical block would waste six lines to say very little. Mixing the two in one file is entirely legal and often produces the most readable result.
YAML infers scalar types from the shape of the text, and unquoted values are resolved against a set of patterns. This is convenient right up until a value happens to match a pattern you did not intend.
| Written as | Parsed as | Quote it to get a string |
|---|---|---|
| no | Boolean false in YAML 1.1 | Write "no" |
| yes / on / off | Booleans in YAML 1.1 | Quote the value |
| 1.20 | Float 1.2, trailing zero lost | Write "1.20" for a version |
| 1.2.3 | String, three dots is not a number | Safe unquoted but quoting is clearer |
| 0755 | Octal integer 493 in YAML 1.1 | Write "0755" for a permission code |
| 12:30 | Sexagesimal number in YAML 1.1 | Write "12:30" for a time |
| null / ~ / (empty) | Null | Write "null" for the literal word |
| @handle | Reserved indicator, parse error | Must be quoted |
| *ref | Alias reference | Must be quoted |
The best known example: a list of ISO country codes containing NO for Norway. Under YAML 1.1 rules, the unquoted token no is a boolean, so Norway silently becomes false and a country vanishes from the list. The same trap catches ON for Ontario and, in some parsers, the chemical formula shorthand and any field where a two letter code is legitimate data. Quote your codes.
Three YAML features have no JSON equivalent at all, and they are the main reason teams prefer YAML for configuration.
Block scalars, comments, and anchors
The pipe indicator keeps line breaks, which is what you want for shell scripts and embedded code. The greater than indicator folds wrapped lines into one paragraph, which is what you want for prose. Anchors and aliases let you define a block once and reuse it, and the merge key pulls those values into another mapping.
| Tool | File | Why YAML |
|---|---|---|
| Kubernetes | Manifests and Helm values | Deeply nested specs that humans edit and review |
| Docker Compose | compose.yaml | Service definitions with shared blocks via anchors |
| GitHub Actions | .github/workflows/*.yml | Multi-line run steps benefit from block scalars |
| Ansible | Playbooks and inventories | Readable task lists that double as documentation |
| OpenAPI | openapi.yaml | Large specs where comments explain intent |
| Static site generators | Front matter and config | Terse metadata at the top of content files |
Config work rarely stops at one format. Browse the full converter collection for YAML to JSON when a tool demands strict JSON, JSON to XML for older enterprise pipelines, and JSON Schema to validate the configuration you just wrote.
Add a JSON object, array, or config payload into the input panel. Use the sample button to load realistic service config data.
Choose indentation, quote strings when needed, and sort keys for stable config diffs.
The YAML output updates live as you type. Copy it into your config file or download a ready to use .yaml document.
Format JSON API payloads, deployment settings, and app config data into readable YAML without sending private values anywhere.
Private configs stay in your browser. No upload pipeline, no server storage.
Convert JSON to YAML as you type with clear errors for invalid input.
Switch indentation, quote strings, or sort keys for predictable output.
Objects, arrays, booleans, numbers, nulls, and empty structures are preserved.
Reverse common YAML config data back into clean JSON with one click.
Copy YAML or download a ready to use file for config and deployment work.
Need to convert YAML back to JSON? Use the YAML to JSON tab or click Swap. Paste any YAML config file including Kubernetes manifests, Docker Compose files, and GitHub Actions workflows and get clean JSON output instantly. The parser supports YAML mappings, lists, strings, numbers, booleans, and null values.