Convert JSON documents into clean, human-readable YAML with configurable spacing and quoting options.
Loading tool
About JSON to YAML Converter
Convert a JSON document into block-style YAML as you type. You can pick 2 or 4 space indentation, single or double quotes, force quotes on every string, and sort keys alphabetically. By default strings are only quoted when YAML would otherwise read them as another type or misparse them.
Common uses
- Turn a JSON config into YAML for Kubernetes, Docker Compose or GitHub Actions
- Make a large JSON API response easier to read
- Convert an OpenAPI or Swagger spec from JSON to YAML
FAQ
- Is every JSON document valid YAML?
- Practically yes: YAML 1.2 was designed as a superset of JSON, so YAML parsers accept JSON input. Converting to block-style YAML mainly makes it easier to read and edit.
- Why are some strings quoted in the output?
- Strings that look like numbers, booleans, null or contain characters with special meaning in YAML must be quoted to keep them as strings. Turn on the quote-all option if you prefer every string quoted.
- Are comments preserved?
- JSON does not support comments, so there are none to carry over. You can add YAML comments with # after converting.