How to convert JSON to YAML online
jsonsql.dev converts JSON to YAML instantly in your browser. No data is sent to any server — your data stays on your machine.
Paste your JSON or YAML — copy your data from an API response, config file, or code and paste it into the input editor on the left.
Choose direction — select JSON → YAML or YAML → JSON using the tabs above the editor. The conversion happens automatically.
Copy the result — click Copy to copy the converted output to your clipboard, or use ⌘+C.
Example
JSON input:
{
"name": "Alice",
"age": 30,
"active": true,
"skills": ["JavaScript", "Python", "Go"],
"address": {
"city": "San Francisco",
"state": "CA"
},
"bio": "Software engineer.\nLoves open source."
}YAML output:
name: Alice
age: 30
active: true
skills:
- JavaScript
- Python
- Go
address:
city: San Francisco
state: CA
bio: |
Software engineer.
Loves open source.Features
- Convert JSON to YAML with proper indentation and block scalars
- Convert YAML back to JSON with correct types (strings, numbers, booleans, null)
- Toggle between JSON → YAML and YAML → JSON modes
- Choose 2-space or 4-space indentation
- Handles nested objects, arrays, and multiline strings
- Special YAML characters are automatically quoted
- Real-time conversion as you type
- Dark and light theme support
- 100% client-side — no data is sent to any server
- Works offline after the page loads
JSON vs YAML comparison
| Feature | JSON | YAML |
|---|---|---|
| Readability | Good with formatting | Excellent — minimal syntax |
| Comments | Not supported | Supported (#) |
| Multiline strings | Escaped \n only | Block scalars (| and >) |
| Data types | String, number, boolean, null, object, array | Same + dates, timestamps |
| Use cases | APIs, data exchange, configs | Configs (Docker, K8s, CI/CD) |
| File size | Larger (braces, quotes) | Smaller (indentation-based) |
| Parsing speed | Faster (simpler grammar) | Slower (complex grammar) |
| Strict syntax | Yes — no trailing commas | Indentation-sensitive |
JSON to YAML vs other tools
| Feature | jsonsql.dev | transform.tools | yq (CLI) |
|---|---|---|---|
| Browser-based | Yes | Yes | No (CLI) |
| Client-side only | Yes | No (server) | Yes (local) |
| Bidirectional | Yes | Separate pages | Yes |
| Indent options | 2 / 4 spaces | Limited | Yes |
| Multiline strings | Block scalars | Varies | Yes |
| Dark mode | Yes | No | N/A |
| Works offline | Yes | No | Yes |
| No install needed | Yes | Yes | No |
Related tools
Frequently asked questions
How do I convert YAML to JSON?
Switch to "YAML → JSON" mode using the tab at the top, paste your YAML, and the JSON output is generated automatically.
What YAML features are supported?
The converter handles objects (mappings), arrays (sequences), strings, numbers, booleans, null values, nested structures, and multiline strings using YAML block scalars (|).
Does it handle multiline strings?
Yes. Strings containing newlines are converted to YAML block scalar syntax (|), which preserves line breaks without escape characters.
Can I use this for Kubernetes or Docker Compose files?
Yes. You can paste JSON and convert it to YAML for use in Kubernetes manifests, Docker Compose files, GitHub Actions workflows, or any YAML-based configuration.
What is the difference between JSON and YAML?
JSON uses braces, brackets, and quotes for structure. YAML uses indentation and minimal syntax. YAML supports comments and multiline strings natively, while JSON does not. Both represent the same data structures.
What happens with special characters in YAML?
Strings containing special YAML characters (like colons, hashes, brackets, or leading/trailing spaces) are automatically quoted to ensure valid YAML output.