Swagger 2.0 to OpenAPI 3.0 Converter

Converts a Swagger 2.0 JSON document to OpenAPI 3.0.3. Host, basePath and schemes become servers, definitions move to components, body and form parameters become request bodies, and security definitions are mapped.

Use the tool

Why this tool exists

Many tools now expect OpenAPI 3. Upgrading a Swagger 2.0 file by hand means moving every definition, rewriting each $ref, and turning body parameters into requestBody objects.

This converter applies those rules locally. Review the result before you publish it: it covers the common cases, not every vendor extension, and it accepts JSON only. Convert YAML to JSON first. You can check the output with the OpenAPI structural validator.

How to use it

  1. Paste your Swagger 2.0 JSON.
  2. Choose an indent.
  3. Copy the OpenAPI 3.0.3 output.
  4. Run it through the OpenAPI validator and a diff against your old file.

Frequently asked questions

Why JSON only?

To keep the page small and exact. Use the YAML to JSON converter first.

What happens to body parameters?

They become requestBody with one content entry per consumes media type.

How are file parameters handled?

type: file becomes a string with format binary, in a multipart form body.

Is OpenAPI 3.1 supported?

No. The output is 3.0.3.