YAML to JSON and back
Paste YAML or JSON and get the other one live. If it’s broken, you’ll see the line and exactly what to change.
Free from Darnly. Spot a bug in the app you're building? Darnly hands it to Claude Code, Codex or Cursor in one key.Add to Chrome
YAML rules that break files most often
- Spaces, not tabs. The start of each line must be spaces. Use the same number for every level (2 is usual).
- Children go further right. Everything that belongs under
steps:starts more to the right thanstepsitself. - A list item starts with “- ”. The keys of that item line up with the first key after the dash.
- Quote things that look like numbers or words.
"3.10","0123","22:22","yes"and"on"are safest in quotes. - A colon followed by a space starts a new key. If a value has
:in it (like a URL with a port or a sentence), put it in quotes.
Need types for this JSON? Use the JSON to TypeScript tool. Comparing two configs? Try the Diff checker.
More free tools
See all 89 tools- JSON to TypeScriptPaste JSON and get TypeScript types and a Zod schema, with optional fields found for you.
- Diff checkerCompare two texts side by side and see every added, removed and changed word. Nothing is uploaded.
- px to rem converterpx to rem and back, live, with the matching Tailwind class and a ruler at real size.
How it works
- Paste YAML on the left or JSON on the right, or drop a
.ymlor.jsonfile onto either box. The other side updates as you type. - The big badge says whether it’s valid. If it isn’t, it tells you the line and what to change in plain words, and that line turns red. Click the message to jump to it.
- Check the yellow notes: they catch values YAML quietly changes, like
3.10becoming3.1. Then copy or download the result, or copy a prompt that asks your AI agent to fix the error.
Questions
How do I convert YAML to JSON?
Paste your YAML in the left box. The JSON appears on the right straight away, ready to copy or download.
Can it convert JSON back to YAML?
Yes. Type or paste in the JSON box instead, and the YAML side is rewritten from it. Whichever side you edit last is the one that’s converted.
Why does my YAML say it’s invalid?
Almost always it’s spaces. YAML uses the spaces at the start of each line to know what belongs to what, so one line with a space too many or too few breaks the file. Tabs aren’t allowed at all. The badge names the line and says how many spaces it needs.
Why did 3.10 turn into 3.1?
YAML reads 3.10 as a number, and the number 3.10 is the same as 3.1. This is a classic GitHub Actions bug: python-version: 3.10 installs Python 3.1. Put it in quotes, "3.10", and it stays as written. The tool flags these for you.
Can I validate a GitHub Actions workflow or docker-compose file?
It checks that the YAML itself is valid and flags values that change meaning, which catches most broken workflow and compose files. It doesn’t check the GitHub or Docker specific keys.
What happens to comments and anchors?
JSON has no comments, so they’re dropped when converting to JSON. Anchors and aliases (&name and *name) are expanded into full copies.
Is my file uploaded?
No. The conversion runs in your browser, so nothing you paste leaves your computer. That matters for config files with keys in them.