JSON Schema to OpenAPI Converter

Convert JSON Schema Draft-07 and 2020-12 into OpenAPI 3.0 and 3.1 YAML or JSON schemas in your browser.

At a glance

JSON Schema to OpenAPI Converter transforms JSON Schema Draft-07 and 2020-12 into OpenAPI 3.0 and 3.1 specifications. It rewrites definitions and $defs into components.schemas references, translates nullable type arrays, preserves validation constraints, and exports formatted YAML or JSON client-side.

Universal Switcher:
From:
To:

100% Client-Side JSON Schema to OpenAPI Converter

Landmark 250th Tool

Transform JSON Schema Draft-04/07/2020-12 into OpenAPI 3.0.3 and 3.1.0 specifications. Automatic $defs reference rewriting, nullable resolution, and YAML/JSON export in browser memory.

Pure In-Browser
Presets:
0 lines • 0 chars
OpenAPI Generation Options
0 schemas
Valid OpenAPI Document

Reference Rewriting

Legacy #/definitions/Name and modern #/$defs/Name references are automatically rewritten to OpenAPI-standard #/components/schemas/Name paths and extracted into top-level components.

OpenAPI 3.0 vs 3.1 Nullable

In OpenAPI 3.0 mode, union type arrays like ["string", "null"] convert to type: string, nullable: true. In OpenAPI 3.1 mode, full JSON Schema 2020-12 multi-type arrays are preserved.

Sub-Millisecond Speed

Engineered with zero external runtime dependencies. Parsing, AST normalization, reference resolution, and YAML serialization execute client-side in under 10ms.

Why Use This JSON Schema to OpenAPI Converter?

100% Client-Side Conversion: All JSON Schema parsing, reference rewriting, and OpenAPI compilation execute in browser memory.
Reference Path Rewriting: Automatically rewrites #/definitions/Name and #/$defs/Name into OpenAPI-standard #/components/schemas/Name paths.
Dual OpenAPI Support: Switch seamlessly between OpenAPI 3.0.3 (nullable true) and OpenAPI 3.1.0 (native multi-type arrays).
Validation Preservation: Accurately preserves properties, items, required, enum, const, allOf, anyOf, oneOf, min/max, and regex patterns.
YAML & JSON Export: Output specifications as formatted YAML or beautified JSON with instant copy and download actions.

How to Use JSON Schema to OpenAPI Converter

1

Paste JSON Schema

Enter or paste your JSON Schema (Draft-04, Draft-07, or Draft 2020-12) into the editor.

2

Select OpenAPI Version & Format

Choose between OpenAPI 3.0.3 or 3.1.0 and select your desired output format (YAML or JSON).

3

Copy or Download Specification

Copy the compiled OpenAPI specification directly or download it as an openapi.yaml or openapi.json file.

JSON Schema to OpenAPI 3.0 Specification

Demonstrates converting a Draft-07 JSON Schema into an OpenAPI 3.0.3 specification with nullable property resolution and components.schemas wrapping.

JSON Schema (Draft-07) Source
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "User",
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "name": { "type": "string" },
    "bio": { "type": ["string", "null"] }
  },
  "required": ["id", "name"]
}
OpenAPI 3.0 YAML Processed
openapi: "3.0.3"
info:
  title: User API
  version: "1.0.0"
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        bio:
          type: string
          nullable: true
      required:
        - id
        - name

Technical Specifications & Engine Details

Technical specifications and engine details for JSON Schema to OpenAPI Converter
Specification Details
Supported Formats JSON → YAML, JSON
Execution Mode 100% Client-Side In-Browser (client)
Browser Requirements Modern browser with JavaScript enabled.
Performance Constraints Zero external dependencies. Runs 100% client-side in browser memory.
Maintained by Pragyan Pahadi

100% Client-Side Privacy Guarantee

Your files and data remain strictly on your local device. Computations run locally using browser memory with zero network uploads.

Frequently Asked Questions

How does this tool handle JSON Schema definitions and $defs?
Internal schema definitions stored in definitions or $defs are automatically extracted into components.schemas, and all local $ref pointers are rewritten to match.
What is the difference between OpenAPI 3.0 and 3.1 output in this tool?
In OpenAPI 3.0, union type arrays containing null (e.g. ["string", "null"]) are converted to nullable: true. In OpenAPI 3.1, native JSON Schema multi-type arrays are fully preserved.
Can I export standalone schema objects without the OpenAPI envelope?
Yes. Simply uncheck the 'Wrap in components.schemas specification envelope' option to emit only the converted schema object.
Is my schema data sent to any server?
No. The entire conversion pipeline runs 100% client-side in your local browser sandbox with zero network uploads.

Methodology

This tool runs entirely in your browser. The example above shows a representative input and the result it produces.

Last updated .