Swagger JSON to YAML

Convert Swagger/OpenAPI JSON to YAML format.

Convert a Swagger or OpenAPI spec from JSON to YAML, the format most people write and review API specs in. The structure, examples and $ref links are kept exactly; only the notation changes. Strings that YAML could misread, such as response codes and version numbers, are quoted. Conversion uses js-yaml in your browser.

Common use cases

  • Make an exported JSON spec easier to read and edit
  • Move a spec into a repository that uses YAML
  • Review API changes in a pull request more easily

How to use

  1. Paste the JSON spec.
  2. Choose the indent.
  3. Copy or download the YAML.

FAQ

Why are response codes in quotes?

OpenAPI response codes are keys like '200'. Quoting keeps them as text, as the specification expects.

Can I check the spec too?

Paste it into the OpenAPI validator.