JSON ↔ YAML Converter
Convert JSON to YAML or YAML to JSON as you type. Errors point to the line that needs fixing. Nothing is uploaded.
How to use JSON to YAML and YAML to JSON Converter on KickSolve
Three quick steps, no account needed.
Why choose KickSolve
Built for speed, privacy and clean results.
What you can do with JSON to YAML and YAML to JSON Converter
Everything this tool is good for.
About JSON to YAML and YAML to JSON Converter on KickSolve
What it does, how it works and how to get the best results.
JSON vs YAML
JSON uses braces, brackets and quotes, which makes it strict and easy for machines to parse. YAML uses indentation and dashes, which makes it easier for people to read and write, and is popular for configuration. They describe the same kinds of data: maps, lists, strings, numbers, booleans and null.
Converting JSON to YAML
Paste valid JSON and you get YAML with your chosen indent. Long strings are not wrapped, so lines stay as written. If the JSON is invalid, check it with the JSON Formatter and Validator.
Converting YAML to JSON
The YAML is parsed and written out as formatted JSON. YAML comments are not part of the data, so they are lost in the conversion. Anchors and aliases are expanded into repeated values, and a file that holds several YAML documents is not supported.
Watch out for YAML types
YAML guesses types, so unquoted values like yes, no, on, off, 1.0 or a date can become booleans, numbers or dates. Quote values that should stay as text, and check the JSON output when it matters.
Related tools
Also see XML Formatter and XML to JSON, JSON to TypeScript and JSONPath Tester.
Worked example: JSON to YAML
The same data in both formats.
JSON:
{"name": "web", "ports": [80, 443], "env": {"DEBUG": false}}
YAML:
name: web
ports:
- 80
- 443
env:
DEBUG: falseUse Swap to turn this YAML back into JSON and check that the round trip matches.
JSON and YAML side by side
How common structures are written.
| Structure | JSON | YAML |
|---|---|---|
| Map | {"a": 1} | a: 1 |
| List | [1, 2] | - 1 and - 2 on separate lines |
| String | "text" | text (quotes optional) |
| Boolean | true | true |
| Null | null | null or ~ |
| Comments | Not allowed | # comment |
Frequently asked questions
Quick answers.
How do I convert JSON to YAML?
Select JSON to YAML, paste your JSON and copy the YAML result. It converts as you type.
How do I convert YAML to JSON?
Select YAML to JSON, paste your YAML and copy the JSON output.
Are YAML comments kept when converting?
No. Comments are not data, so they are dropped when YAML is converted to JSON.
Why did a value change type?
YAML infers types, so unquoted yes, no, on, off, numbers and dates can become booleans, numbers or dates. Put quotes around values that should stay as strings.
Does it support multiple YAML documents?
No. It converts a single document. Split files that use --- separators and convert each part.
What does Swap do?
It moves the current result into the input and flips the direction, so you can check a round trip.
What if the JSON is invalid?
You get an error message. Validate and fix it with the JSON Formatter first.
Is my data uploaded?
No. Conversion runs in your browser. The YAML library is loaded from a CDN, but your data never leaves your device.
More free tools from KickSolve
Related free tools. Each one runs in your browser too.