ProductCompareToolsPricingBlog
Sign inCreate an account
  1. Blog
  2. API Documentation

OpenAPI vs Swagger: What's the Difference?

OpenAPI is the specification. Swagger is its old name and, today, a family of SmartBear tools. Here is the history, the version timeline, and what actually changed between Swagger 2.0 and OpenAPI 3.

Morgan Kotter · Updated December 3, 2026

OpenAPI is the specification: the standard format for describing an HTTP API in a YAML or JSON file. Swagger is the original name of that specification, used through version 2.0, and today the brand name of SmartBear's tools for working with it, such as Swagger UI and Swagger Editor.

So "Swagger 2.0" and "OpenAPI 2.0" are the same document format. Everything from 3.0 onward is only called OpenAPI. When someone says "Swagger" today, they usually mean one of three things: a 2.0 spec file, the Swagger UI docs page, or the spec in general out of habit.

OpenAPI vs Swagger at a glance

OpenAPI Swagger
What it is A specification (a file format) The spec's former name, now a brand of tools
Who owns it OpenAPI Initiative, a Linux Foundation project SmartBear Software
License Apache 2.0 Open source tools (Swagger UI, Editor, Codegen) plus the commercial SwaggerHub
Versions 2.0, 3.0.x, 3.1.x, 3.2.x 1.0 to 2.0 as a spec name
Top-level key in the file openapi: 3.x.x swagger: "2.0"
Latest version 3.2.1 (September 2026) 2.0 (September 2014)

The short rule: a spec file is an OpenAPI document; Swagger UI is a program that reads one.

A short history

Swagger started in 2010 at Wordnik, an online dictionary, where Tony Tam was CTO. He needed a way to describe Wordnik's API so that docs and client libraries could be generated from one source. The first release of the Swagger Specification, 1.0, came out on August 10, 2011.

The timeline from there, using the dates in the OpenAPI Specification's own revision history:

  • 2012-08-22: Swagger 1.1.
  • 2014-03-14: Swagger 1.2, the first formal spec document.
  • 2014-09-08: Swagger 2.0, the version most older APIs still use.
  • March 2015: SmartBear Software acquired the Swagger project from Reverb Technologies (Wordnik's parent company), and Tam joined SmartBear.
  • November 2015: SmartBear, Google, IBM, Microsoft, PayPal, Apigee, Capital One, Intuit, 3Scale and Restlet announced the OpenAPI Initiative as a Linux Foundation project.
  • 2015-12-31: Swagger 2.0 was formally donated to the OpenAPI Initiative. The specification became the OpenAPI Specification; SmartBear kept the Swagger name for its tools.
  • 2017-07-26: OpenAPI 3.0.0, the first version released under the OpenAPI name.
  • 2021-02-15: OpenAPI 3.1.0, aligned with JSON Schema 2020-12.
  • 2025-09-19: OpenAPI 3.2.0.
  • 2026-09-10: OpenAPI 3.2.1, a patch release and the current latest version.

That split is why the confusion exists. The spec moved to a neutral foundation and got a new name, while the most popular tools kept the old one.

Spec versions compared

Version Released Latest patch Known for
Swagger 2.0 Sep 2014 2.0 host, basePath, definitions, body parameters
OpenAPI 3.0 Jul 2017 3.0.4 servers, components, requestBody, callbacks, links
OpenAPI 3.1 Feb 2021 3.1.2 Full JSON Schema 2020-12, webhooks, type: [string, "null"]
OpenAPI 3.2 Sep 2025 3.2.1 Nested tags, the QUERY method, itemSchema for streams, OAuth device flow

The jump from 2.0 to 3.0 is the big structural one. The 3.x releases after that are smaller and mostly additive, with 3.1 as the exception: its JSON Schema change breaks some 3.0 schemas. We cover that in detail in OpenAPI 3.1 vs 3.0.

Swagger 2.0 vs OpenAPI 3.0, side by side

Here is the same endpoint, POST /pets, written both ways.

Swagger 2.0

swagger: "2.0"
info:
  title: Pet Store
  version: 1.0.0
host: api.example.com
basePath: /v1
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
paths:
  /pets:
    post:
      summary: Add a pet
      parameters:
        - in: body
          name: pet
          required: true
          schema:
            $ref: "#/definitions/Pet"
      responses:
        "201":
          description: Created
          schema:
            $ref: "#/definitions/Pet"
definitions:
  Pet:
    type: object
    required: [name]
    properties:
      id:
        type: integer
      name:
        type: string

OpenAPI 3.0

openapi: 3.0.3
info:
  title: Pet Store
  version: 1.0.0
servers:
  - url: https://api.example.com/v1
paths:
  /pets:
    post:
      summary: Add a pet
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Pet"
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Pet"
components:
  schemas:
    Pet:
      type: object
      required: [name]
      properties:
        id:
          type: integer
        name:
          type: string

What moved:

Swagger 2.0 OpenAPI 3.0
swagger: "2.0" openapi: 3.0.3
host + basePath + schemes servers (a list of full URLs, with optional variables)
definitions components/schemas
parameters with in: body requestBody
in: formData parameters requestBody with a form media type
consumes / produces content, keyed by media type, on each request and response
securityDefinitions components/securitySchemes
type and format directly on a parameter schema on the parameter

The content change matters more than it looks. In 2.0, produces was one list for the whole operation, so you could not say "JSON returns this schema, CSV returns that one." In 3.0 each media type gets its own schema.

3.0 also added things 2.0 had no way to express: oneOf and anyOf, callbacks for webhooks your API sends, links between operations, and multiple servers per API.

Which one should you use today

Write new specs in OpenAPI 3.1 unless a tool you depend on only reads 3.0. Current tools support it well, and it uses standard JSON Schema, so your schemas also work in ordinary JSON Schema validators. Move to 3.2 when you need one of its additions (nested tags, QUERY, streaming) and your tools have caught up.

If you have a Swagger 2.0 spec, convert it. Nothing forces you to: Swagger UI still renders 2.0, and plenty of production APIs still ship it. The reasons are practical:

  • Most new tooling is built for 3.x first, and some of it skips 2.0 entirely.
  • 2.0 cannot describe per-media-type responses, oneOf, callbacks or multiple servers.
  • Generated clients from a 3.x spec tend to model request bodies and polymorphic types better.

If your spec is generated from code (Springfox, Swashbuckle, FastAPI, and similar), check whether your framework's library can emit 3.x directly. Changing the generator setting is better than converting its output on every build.

How to convert Swagger 2.0 to OpenAPI 3

The fastest way is our free Swagger 2.0 to OpenAPI 3.0 converter. Paste a 2.0 spec in YAML or JSON and you get an OpenAPI 3.0.3 document back, in either format. It runs in your browser, so the spec is never uploaded. It handles the mappings in the table above: host/basePath/schemes to servers, body and form parameters to requestBody, definitions to components/schemas, securityDefinitions to components/securitySchemes, and every $ref path along with them.

After converting, check these by hand, because no automatic conversion gets them all right:

  1. Form parameters. Converted form fields land under multipart/form-data. If your endpoint takes application/x-www-form-urlencoded, change the media type. A 2.0 type: file field should become type: string, format: binary.
  2. Array query parameters. 2.0's collectionFormat maps to style and explode in 3.0. Set them to match how your server parses csv, multi or pipes values.
  3. Response examples. 2.0 examples keyed by MIME type belong under each media type's example or examples in 3.0, so move them there.
  4. Vendor extensions. Check that your x- fields are still where the tools that read them expect.

Then validate the result. Paste it into the OpenAPI validator to catch broken $refs and misplaced keys, and look it over in the OpenAPI viewer to confirm every endpoint made it across. If the validator reports something you don't recognize, common OpenAPI validation errors explains the usual causes.

The converter targets 3.0.3 because that is the safest common version. To go on to 3.1, follow the steps in OpenAPI 3.1 vs 3.0; the main work is replacing nullable: true and adjusting exclusiveMinimum/exclusiveMaximum.

Where docs fit in

Whichever version you land on, the spec is only useful if people can read it. Swagger UI is the default choice for a self-hosted docs page; we compare it with hosted options in Specway vs Swagger UI.

Specway takes the other route: paste the URL of your OpenAPI file and it hosts a docs site with a page per endpoint, a request playground, code samples in five languages, and llms.txt and mcp.json for AI agents, and it re-reads the spec when the file changes. It is free for one API if you want to try it with your own spec.

FAQ

Is Swagger the same as OpenAPI?

For version 2.0, yes: Swagger 2.0 and OpenAPI 2.0 are the same specification under two names. From 3.0 onward the spec is only called OpenAPI, and "Swagger" refers to SmartBear's tools, such as Swagger UI, Swagger Editor and SwaggerHub.

Is Swagger 2.0 deprecated?

The OpenAPI Initiative still publishes the 2.0 spec, and Swagger UI still renders it, so it works. It is no longer developed, though. Every change since 2017 has gone into 3.x, and new tools increasingly support only 3.x. Treat it as legacy and plan a conversion with the 2.0 to 3.0 converter.

What is Swagger UI?

Swagger UI is an open source (Apache 2.0) web page that renders an OpenAPI or Swagger 2.0 file as interactive documentation, with a "Try it out" button for each operation. It reads the spec; it is not the spec. Most web frameworks have a package that serves it from your own app.

What is the latest version of OpenAPI?

OpenAPI 3.2.1, a patch release published on September 10, 2026. The 3.2 line started with 3.2.0 on September 19, 2025. The OpenAPI Initiative also maintains patch releases of 3.1 (latest 3.1.2) and 3.0 (latest 3.0.4).

Can I use Swagger tools with OpenAPI 3?

Yes. Swagger UI, Swagger Editor and Swagger Codegen all read OpenAPI 3 files. Check the release notes for the exact minor version you need, since support for each new 3.x version arrives after the spec itself.

Morgan Kotter is a product manager and indie founder in Utah. He spent seven years forward-deployed in enterprise SaaS at Lucid, now Marq, and he builds and runs Specway himself.

Read next

  • 12 API Documentation Examples Worth CopyingTwelve public API docs from Stripe, Twilio, GitHub, Plaid, Resend, Shopify, Linear, Anthropic, Cloudflare, DigitalOcean and Vercel, with the one pattern from each that is worth stealing for your own docs.
  • The True Cost of API Documentation: Build vs Buy AnalysisCustom docs seem free until you count engineering hours, maintenance, and the cost of outdated information. Here is a realistic breakdown.
  • OpenAPI 3.1 vs 3.0: What Changed and Why It MattersOpenAPI 3.1 brought full JSON Schema compatibility, webhooks, and subtle breaking changes. Here is what you need to know before migrating.

See your docs in a minute

Paste the link to your OpenAPI file. Free for one API, no card needed.

Get startedSee pricing

API reference docs from your OpenAPI file.

Product

  • How it works
  • Endpoint pages
  • Code samples
  • Spec sync
  • Spec changes
  • API versions
  • Changelog
  • Recipes
  • Docs assistant
  • Your domain and look
  • Insights
  • Private docs
  • Team SSO
  • Pricing

Compare

  • vs ReadMe
  • vs Mintlify
  • vs Redocly
  • vs Scalar
  • vs Swagger UI
  • Postman alternatives
  • All comparisons

Tools

  • OpenAPI validator
  • OpenAPI diff
  • Swagger 2 to OpenAPI 3
  • cURL to code
  • JWT decoder
  • YAML and JSON
  • llms.txt generator
  • All tools

Resources

  • Guides
  • OpenAPI errors
  • Glossary
  • Public APIs directory
  • Blog
  • Help
  • llms.txt
  • llms-full.txt

Company

  • About
  • Contact
  • Privacy
  • Terms

© 2026 Specway. Made in Utah by Modlific LLC.

GitHubXLinkedIn