YAML to JSON Converter
Convert YAML to JSON and vice versa instantly.
Error:
Input (YAML)
Output ()
Lines:
Size:
Features
- Convert YAML to JSON
- Convert JSON to YAML
- Auto-convert on input
- Proper 2-space indentation
YAML Example
# Config file
database:
host: localhost
port: 5432
users:
- admin
- guest
cache:
enabled: true
ttl: 3600
About the YAML to JSON Converter
YAML and JSON describe the same kinds of data. YAML is easier for people to write, such as in Docker Compose or Kubernetes files, while JSON is what most APIs and programs read.
How to use it
- 1 Paste YAML or JSON into the input.
- 2 Choose the direction to convert.
- 3 Fix any reported syntax error, then copy the output.
Frequently asked questions
Is all YAML valid JSON?
No, but all JSON is valid YAML 1.2. YAML adds comments, anchors, and multi-line strings, which have no direct JSON equivalent.
Are YAML comments kept?
No. JSON has no comments, so they are dropped when converting from YAML to JSON.
Why does my YAML fail to parse?
The most common causes are tabs instead of spaces for indentation, inconsistent indentation, and a missing space after a colon.