JSON to YAML Converter
Switch config files between JSON and YAML, for Kubernetes, Docker Compose, GitHub Actions or OpenAPI. Paste either format, choose the direction, and copy the result.
How to convert between JSON and YAML
- 1Paste JSON or YAML, or open a file.
- 2Choose “JSON to YAML” or “YAML to JSON”.
- 3Copy or download the result. Use Swap to convert it back.
Safe YAML reading
YAML is read with the JSON schema, so “yes”, “no” and “on” stay as text instead of turning into true and false, and nothing in the YAML can run code. That avoids the surprises older YAML parsers are known for.
Several documents
A YAML file with several documents separated by “---”, as in many Kubernetes manifests, becomes a JSON array with one item per document.
Errors with line numbers
Invalid JSON or YAML shows the line and column of the problem. In YAML, the most common causes are tabs used for indentation and inconsistent indent sizes.
Frequently asked questions
- Is my config uploaded?
- No. Conversion happens in your browser, so secrets in config files stay on your device.
- Are YAML comments kept?
- No. JSON has no comments, so they're dropped when converting YAML to JSON.
- Does it support anchors and aliases?
- Yes. Anchors (&) and aliases (*) are expanded into full values in the JSON.