OpenAPI to JSON Schema Converter — Free Online

Extract OpenAPI 3.0–3.2 components.schemas into JSON Schema — default Draft 2020-12 ($defs), optional Draft-07 (definitions). Browser-local, no upload.

Loading…
OpenAPI to JSON Schema documentation
Extract OpenAPI components.schemas into JSON Schema (2020-12 or Draft-07).

Developer notes

• OpenAPI 3.0 schemas convert via @openapi-contrib/openapi-schema-to-json-schema. • OpenAPI 3.1 / 3.2 use a best-effort strip of OAS-only keywords. • Default output: $schema 2020-12 + $defs; optional Draft-07 remap ($schema + definitions + #/definitions refs). • Live convert on paste/sample; explicit Convert (⌘↵) for manual edits; Monaco JSON/YAML input + Shiki JSON output. • Empty components.schemas → error. • External $ref rejected. • Max input 512 KiB.

Options

Target draft
2020-12 (default) emits $schema + $defs. Draft-07 remaps to the Draft-07 $schema URI, definitions instead of $defs, and #/definitions/… refs — a structural rename only; 2020-12-only keywords are not rewritten.

Use cases

• Reuse OpenAPI models as standalone JSON Schema. • Feed extracted schemas into JSON Schema Validator. • Diff schema shapes outside of a full OpenAPI document.

Examples

OpenAPI YAML → JSON Schema $defs

Before

openapi: "3.0.3" info: title: Pets version: 1.0.0 paths: {} components: schemas: Foo: type: object properties: id: type: string Bar: type: object properties: name: type: string

After

{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "Foo": { ... }, "Bar": { ... } } }

Empty schemas rejected

Before

openapi: "3.0.3" info: title: t version: "1" paths: {} components: schemas: {}

After

Error: empty components.schemas

OpenAPI to JSON Schema FAQ

Common questions

Is 3.1 conversion identical to Draft-07?

No. OpenAPI 3.1/3.2 conversion is a best-effort keyword strip. Default output is Draft 2020-12 ($defs). Choose Draft-07 for a structural remap (definitions + Draft-07 $schema) — not a full keyword rewrite. See Options.

What if there is no Root schema?

All schemas land under $defs (or definitions when Draft-07 is selected) with no invented root type/properties. A schema named Root also gets a top-level $ref to that entry.

Related tools?

Convert the other way with JSON Schema to OpenAPI, or validate the OpenAPI source with Validate OpenAPI.

API & schemas

OpenAPI tools to format, validate, and lint your specs.

Explore other tool categories

Minify

Shrink code and assets for production — minify JavaScript, CSS, HTML, JSON and XML before gzip or CDN deploy.

Beautify

Make code readable with consistent indentation — beautify JavaScript, CSS, TypeScript, SCSS, LESS, Markdown, GraphQL, SQL, YAML and more in your browser.

Unminify

Expand minified or compressed code — unminify JavaScript, CSS, TypeScript, SCSS, LESS, SQL, YAML and other formats when debugging or reviewing.

Conversion

Transform data between JSON, YAML, XML and CSV locally — no server uploads.

CSS preprocessors

Compile SCSS or LESS to standard CSS in the browser — pair with beautify or minify for a full stylesheet workflow.

JSON Tools

Validate, format, diff and explore JSON payloads — complementary to minifiers and converters.

SVG Tools

Preview, optimize with SVGO, export Data URI, resize, beautify, convert to JSX and validate SVG — all in your browser.

DevOps & Infra

Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.

CI/CD

GitHub Actions and GitLab CI — format YAML and check workflow/job structure in your browser.

Logs & observability

Line-oriented JSON/NDJSON and Nginx/Apache access logs — format, filter, validate, and CSV/TSV.

Kubernetes

Multi-doc manifests, structural validate, Ingress/Deployment starters, and Helm values formatting.

Networking / IP

CIDR, subnets, and IPv4/IPv6 helpers — in your browser.

Security & tokens

JWKS, X.509 certificates, and secrets scan — browser-local.

Encoding

Encode or decode Base64, URL components and HTML entities — client-side only.

Developer utilities

Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugify, number bases, case, text diff, and chmod — all client-side.

Text & Markdown

Count words, build Markdown TOCs, and clean line lists — all in your browser.

Serialization

Serialize and deserialize PHP data structures beside JSON workflows.