YAML ↔ JSON Converter
Convert between YAML and JSON instantly in your browser, ideal for Kubernetes manifests, GitHub Actions workflows, and other config files. Spot YAML syntax errors as you go, with nothing sent to a server.
Usage examples
Moving a config file to a different format
Convert a YAML config, like a Docker Compose or GitHub Actions file, before pasting it into a tool that only accepts JSON.
Turning a JSON API response into readable YAML
Convert a brace-heavy JSON response into indentation-based YAML so the structure is easier to scan at a glance.
Quickly spotting a YAML syntax error
Paste in YAML broken by an indentation or colon mistake and see exactly what's wrong from the error message.
Converting a Kubernetes manifest to JSON for a script
Turn a Deployment or ConfigMap YAML manifest into JSON so a script using a JSON-only library can read and modify its fields.
Writing a GitHub Actions workflow from a JSON template
Start from a JSON object describing your workflow steps and convert it to the YAML syntax GitHub Actions expects in .github/workflows.
Quick reference
YAML → JSON
| YAML | JSON |
|---|---|
| name: Ada | {"name":"Ada"} |
| age: 42 | {"age":42} |
| pi: 3.14 | {"pi":3.14} |
| version: 1.10 | {"version":1.1} |
| zip: 01234 | {"zip":1234} |
| hex: 0x1F | {"hex":31} |
| enabled: true | {"enabled":true} |
| answer: yes | {"answer":"yes"} |
| empty: null | {"empty":null} |
| tilde: ~ | {"tilde":null} |
| blank: | {"blank":null} |
| quoted: '42' | {"quoted":"42"} |
| tagged: !!str 123 | {"tagged":"123"} |
| date: 2024-01-15 | {"date":"2024-01-15T00:00:00.000Z"} |
| key: value # comment | {"key":"value"} |
| list: [a, b, c] | {"list":["a","b","c"]} |
| map: {x: 1, y: 2} | {"map":{"x":1,"y":2}} |
| list:\n - a\n - b | {"list":["a","b"]} |
| nested:\n child: 1 | {"nested":{"child":1}} |
| literal: |\n line 1\n line 2 | {"literal":"line 1\nline 2\n"} |
| folded: >\n line 1\n line 2 | {"folded":"line 1 line 2\n"} |
JSON → YAML
| JSON | YAML |
|---|---|
| {"a": "hello"} | a: hello |
| {"a": "123"} | a: '123' |
| {"a": "1.5"} | a: '1.5' |
| {"a": "010"} | a: '010' |
| {"a": "yes"} | a: 'yes' |
| {"a": "on"} | a: 'on' |
| {"a": "true"} | a: 'true' |
| {"a": "null"} | a: 'null' |
| {"a": "~"} | a: '~' |
| {"a": ""} | a: '' |
| {"a": " padded"} | a: ' padded' |
| {"a": "x: y"} | a: 'x: y' |
| {"a": "#tag"} | a: '#tag' |
| {"a": "@user"} | a: '@user' |
| {"a": "2024-01-15"} | a: '2024-01-15' |
| {"a": "line1\nline2"} | a: |-\n line1\n line2 |
| {"a": null} | a: null |
| {"a": [1, 2]} | a:\n - 1\n - 2 |
| {"a": {"b": 1}} | a:\n b: 1 |
Frequently asked questions
Is what I enter sent to a server?
No. All conversion happens entirely in your browser, and what you enter is never sent to a server.
Does it support complex YAML, like anchors or multiple documents?
It supports most of standard YAML 1.1/1.2, including anchors and aliases. Just keep a single document in the input.
What happens to values JSON can't represent, like undefined?
JSON can't represent values like undefined or functions, so avoid including them in the input before converting. Ordinary strings, numbers, booleans, arrays, objects, and null all convert fine.
Is the original indentation and line breaks preserved?
The output is freshly generated using the library's default formatting, so original comments or specific line-break styles aren't preserved.
Why does my YAML's 'yes', 'no', or 'on' turn into a boolean?
YAML 1.1 treats certain bare words like yes, no, on, off, and null as special values rather than plain strings. If you need the literal text, wrap it in quotes in your YAML, like "yes".
What's the actual difference between YAML and JSON here?
They represent the same kinds of data — objects, arrays, strings, numbers, booleans, and null — but YAML uses indentation and dashes instead of braces and commas, and it also supports comments, which JSON does not. Converting JSON to YAML never loses data, but comments added to YAML by hand are lost if you convert that YAML to JSON and back.
Does it handle multi-line string styles like the pipe (|) or greater-than (>) in YAML?
Yes. Block scalars (both the literal | style, which preserves line breaks, and the folded > style, which joins lines) are parsed into a single JSON string with the appropriate line breaks or spaces.