JSON to YAML
Convert JSON data to YAML configuration format.
Convert JSON to YAML, the indentation-based format used by Kubernetes, Docker Compose, GitHub Actions and many config files. Paste JSON and get clean YAML with 2 or 4-space indentation, optionally with keys sorted alphabetically. Strings that YAML would misread, such as "yes", "1.0" or values with colons, are quoted automatically. Long strings aren't folded, so values stay on one line. It runs in your browser with js-yaml.
Common use cases
- Turn a JSON API example into a YAML config
- Convert an OpenAPI spec from JSON to YAML
- Write Kubernetes or Compose files from JSON output
- Make JSON easier to read and comment
How to use
- Paste the JSON.
- Choose the indent and whether to sort keys.
- Copy or download the YAML.
FAQ
Why are some values in quotes?
Without quotes, YAML would read them as another type (yes as a boolean, 1.0 as a number) or misread a colon. Quotes keep them as strings.
Is YAML a superset of JSON?
Almost: valid JSON is nearly always valid YAML. Converting gives you YAML's more readable style.
Can I check the result?
Yes. Paste it into the YAML validator.
Related tools
- YAML to JSONConvert YAML configuration files to JSON format.
- JSON to XMLConvert JSON data to XML document format.
- JSON to CSVConvert JSON arrays to CSV spreadsheet format.
- CSV to JSONConvert CSV data to JSON format for APIs and applications.
- XML to JSONConvert XML documents to JSON format.
- CSV Diff CheckerCompare two CSV files and highlight differences.