Paste a YAML file — a Kubernetes manifest, a Compose file, an OpenAPI spec — and get JSON. Runs entirely in this tab, so a config file full of secrets stays on your machine.
Multi-document files
---, and Kubernetes manifests almost always do. JSON has no equivalent, so the documents are combined into a top-level array in order, and you are told how many there were. If you needed them separate, split the file on --- first.Anchors, aliases and merge keys
&name) and aliases (*name) are resolved: the referenced content is expanded in place, because JSON has no way to express a reference. Merge keys (<<: *defaults) are applied too. This means the JSON is larger than the YAML, sometimes considerably, and the sharing is gone — two aliases of the same anchor become two independent copies.Where YAML files usually break
The second most common cause is a missing space after a colon: key:value is a single scalar string, not a mapping. The third is inconsistent indentation between sibling keys.
Other names for this
Also searched as “yml to json”, “convert yaml to json online”.
Questions
- My Kubernetes manifest became a JSON array.
- That file contains several documents separated by
---. JSON has no multi-document concept, so they are combined into an array in order. - The file will not parse and looks fine to me.
- Check for tab characters. YAML forbids them for indentation, and they are invisible. The error message names the line.
- Are comments kept?
- No. JSON has no syntax for comments, so they are dropped.
- Is my data uploaded anywhere?
- No. The conversion runs as JavaScript inside this tab. Open your browser's Network panel and convert something — you will see no request carrying your data, because there is no server to send it to. You can also turn your Wi-Fi off and convert anyway.