YAML to JSON Converter
Paste a YAML file and get the JSON, or flip it the other way.
The answer appears here as you type.
Guide: Both directions on one page3 min read
Both directions on one page
Paste the YAML — a docker-compose file, a Kubernetes manifest, a GitHub Actions workflow — and the JSON appears beside it, indented with 2 or 4 spaces. The swap button goes the other way: JSON from an API becomes readable YAML, with lists as dashes and long strings kept on one line instead of folded.
A file with several documents separated by --- becomes a JSON list, one item per document. Any JSON file is also valid YAML, so pasting JSON in the YAML → JSON direction simply reformats it.
YAML 1.2, and why it matters
In YAML 1.1, yes, no, on and off were booleans, and bare dates became dates. The effect is well known: a list of countries with NO for Norway reached the program as false. This converter follows YAML 1.2, where only true and false are booleans and words and dates stay text. Numbers are still numbers in both versions — a version 1.10 without quotes comes out as 1.1 — so quotes remain the right protection for anything that only looks numeric.
A key repeated in the same mapping is an error, with its line and column. Some parsers keep the last value without a word, which is how a setting duplicated by copy and paste goes unnoticed for months. A document that multiplies itself through anchors and aliases (*ref) beyond reason is stopped before it freezes the tab.
Nothing is uploaded
Config files tend to hold server names, internal URLs and sometimes a password that should not be there. The conversion happens in this tab and nothing leaves your computer. To tidy the resulting JSON, use the JSON formatter; to see what changed between two versions of the file, text compare.
Frequently asked questions
Why does NO stay "NO" instead of turning into false?
Because the converter follows YAML 1.2, where only true and false are booleans. YAML 1.1 also read yes, no, on and off as booleans, which famously turned Norway's country code into false. Many older tools still do that; if you need a string to be unambiguous in every parser, put it in quotes.
What happens to a file with several documents separated by ---?
JSON can only hold one value, so the documents become a JSON list with one item per document, in order. Kubernetes manifests with a Deployment and a Service in the same file come out as a two-item array.
Are comments kept when converting to JSON?
No. JSON has no comment syntax, so they are dropped. Converting back from JSON to YAML cannot bring them back either: keep the original YAML if the comments matter.
The error says the keys must be unique. Why?
The same key appears twice in one mapping. Some parsers silently keep the last value, which hides a real mistake — usually a copy-paste or an indentation slip. The line in the error is where the repeated key starts.
Is my file uploaded?
No. The conversion runs in this tab, which matters for config files full of hostnames, internal URLs and sometimes secrets. The page works offline once it has loaded.