YAML to JSON Converter
Private: nothing leaves your browser
Paste YAML on the left and the JSON appears on the right.
Paste a Compose file, a CI pipeline or a Kubernetes manifest and get the JSON equivalent as you type, with the line number named when something will not parse. Your config is converted on your own device, so credentials in it stay with you.
About converting YAML to JSON
YAML and JSON describe the same shapes: mappings, sequences, strings, numbers, booleans and null. YAML is the one people write by hand because the indentation replaces most of the punctuation, and JSON is the one programs read because there is only one way to spell anything. Converting between them is how you get a hand-written config into a tool that only accepts JSON, or how you check what a fiddly piece of YAML actually means.
The conversion runs on this page. Nothing is uploaded, which matters more than usual here: config files are exactly where API keys, connection strings and internal hostnames tend to live. It also means the converter keeps working with your connection switched off.
Comments are the one thing JSON cannot carry, so they are dropped. Everything else comes across: nested blocks, flow style such as ports: [80, 443], block scalars written with | or >, quoted and unquoted strings, and multiple documents separated by ---, which come back as a JSON array. The result is minified on one line by design; the JSON formatter is there if you want it indented.
How to convert YAML to JSON
- Paste your YAML into the left box. The JSON appears on the right as you type.
- If something will not parse, the status line names the line number and what it expected.
- Switch to JSON to YAML to go the other way.
- Result to input feeds the output back in, which is a quick way to check a file round trips unchanged.
- Press Copy to take the result.
Common questions about YAML to JSON
My Compose file has secrets in it. Is pasting it safe?
Why did my country code NO become false?
no as the boolean false, which is why the country code for Norway turns into false. That is the Norway problem. This converter follows YAML 1.2, where only true and false are booleans and no, yes, on and off all stay strings, so it does not happen here. If your own parser still does it, quote the value as "NO".
What is not supported?
&base and *base), merge keys (<<:), explicit tags such as !!str, and the explicit key form. Each of those is reported by name rather than quietly mishandled, because a converter that silently drops part of your config is worse than one that says it cannot. Expand them first and the rest converts.
What happens to my comments?
Why does it complain about a tab?
.yml and .yaml files and the problem goes away for good.Next