YAML to JSON converter
Paste YAML, for example a docker-compose.yml or a Kubernetes manifest, and get clean JSON. If the YAML is invalid, you see on which line and at which character it goes wrong, so this also works as a YAML validator.
How it works
-
Paste your code
Paste the code in the left box or open a file. No code to hand? Click Example.
-
Instant result
The result appears as you type. If there is an error, you see the line and character.
-
Copy or download
Copy the result with one click or save it as a file for your editor or project.
What gets converted?
- Comments with
#are dropped, because JSON has no comments. - Anchors and aliases (
&defaultsand*defaults) are written out in full. - Multiple documents, separated by
---, are combined into one JSON array. true,false,nulland numbers become real JSON values;yesandnostay text (as in YAML 1.2).
Common YAML mistakes
- Using tabs to indent. YAML only accepts spaces.
- Uneven indentation: all keys on the same level must be indented exactly the same.
- A colon inside a value without quotes, such as
title: Note: new. Put the value in quotes.
Going the other way? Use JSON to YAML.
Frequently asked questions
Is the YAML to JSON free?
Yes. The YAML to JSON is completely free, with no account, sign-up or usage limit.
Is my code stored?
No. Your code is processed in your browser and is not sent to a server or stored.
Does it work on my phone?
Yes. The tool works in any modern browser on a phone, tablet or computer.