Paste JSON and get clean, readable YAML as you type.
Paste JSON, upload a .json file or drop one here.
Updates as you type. Copy it or download a .yaml file.
Converting…
This free JSON to YAML converter turns any JSON document into clean, block-style YAML. Paste an API response, a package.json-style config or a Kubernetes manifest written in JSON, and the YAML version appears instantly, with your key order, nesting and data types preserved. There is nothing to install and no sign-up, and because the conversion runs in your browser, your data is never uploaded.
YAML is easier to read and edit by hand than JSON: no braces, no trailing-comma errors, and room for comments. That is why tools such as Kubernetes, Docker Compose, GitHub Actions, Ansible and OpenAPI use it for configuration. Converting JSON to YAML is the quickest way to move data you already have into one of those files.
.json file. You can also drag a file onto the editor.data.yaml.Objects become indented key: value pairs and arrays become lists of - items. Notice that the country code NO is quoted in the output; the next section explains why.
{
"name": "web",
"replicas": 2,
"debug": false,
"ports": [80, 443],
"labels": {
"tier": "frontend",
"country": "NO"
}
}name: web replicas: 2 debug: false ports: - 80 - 443 labels: tier: frontend country: "NO"
| JSON | YAML output | Notes |
|---|---|---|
{ } object | Indented key: value pairs | An empty object is written {}. |
[ ] array | Lines starting with - | An empty array is written []. |
| string | Plain text, quoted only when needed | Multi-line strings use a | block so line breaks are kept. |
| number | Unchanged | Large numbers keep exponent form, such as 1e+21. |
true / false | true / false | Always lower case. |
null | null | Written out explicitly, never left blank. |
YAML 1.1, still used by PyYAML, go-yaml and therefore Kubernetes and Helm, reads unquoted yes, no, on, off and NO as booleans, and values such as 2024-01-01 as dates. A country list containing Norway (NO) famously turned into false. This converter quotes any string that could be misread like that, along with numeric-looking strings such as version "1.10", so the YAML means exactly what your JSON meant in every parser.
Still deciding between the two formats? Read our comparison of YAML vs JSON. If you need sample data to try the converter with, create some with the JSON Generator, and to go the other way, use the YAML to JSON converter.
Paste your JSON into the JSON Input editor, or upload a .json file. The YAML appears in the output editor as you type. Copy it, or click Download to save it as data.yaml.
Yes. Since YAML 1.2, any valid JSON document is also valid YAML, so a YAML parser can read JSON directly. Converting to YAML's block style is still worth it for files that people edit, because it drops the braces, brackets and most quotes.
Older YAML 1.1 parsers, which include PyYAML and the Go library behind Kubernetes, read unquoted values such as yes, no, on, off, NO and 2024-01-01 as booleans or dates. The converter quotes those strings, plus numeric-looking strings such as "1.10", so they stay strings in every parser.
Yes. Keys are written in the same order as in your JSON. Tick Sort keys A–Z if you want them sorted alphabetically instead, which makes diffs between config files easier to read.
Yes. Use the YAML to JSON converter, or click Swap direction above the editors. Converting JSON to YAML and back gives you the same data.
No. The conversion runs entirely in your browser with JavaScript, so your data never leaves your device. That makes it safe to use with config files that contain internal hostnames or other private values.