How to convert YAML to JSON (and back)
- Paste YAML on the left and choose YAML → JSON, or paste JSON on the right and choose JSON → YAML.
- If there’s a mistake, the message shows the line and column.
- Copy the result from the other side.
Only need to tidy JSON? Use the JSON formatter. Turning JSON into code types? Try JSON to TypeScript.
Frequently asked questions
What's the difference between YAML and JSON?
They hold the same kind of data: lists, key-value maps, text and numbers. JSON uses braces, brackets and quotes and is common in APIs. YAML uses indentation instead, allows comments, and is common in config files like Docker Compose, Kubernetes and GitHub Actions.
Are YAML comments kept?
Comments can't be stored in JSON, so they're dropped when converting YAML to JSON. Everything else, including anchors and aliases, is turned into plain JSON values.
Why does my YAML give an error?
Most often it's indentation: YAML uses spaces (not tabs), and items at the same level must line up exactly. The error message gives the line and column to look at.
Is my data uploaded?
No. Converting happens in your browser, so it's safe for config files with secrets.