JSON Schema to Prisma Schema Converter

Transform JSON Schema models and required constraints into production-ready schema.prisma files.

At a glance

JSON Schema to Prisma Schema Converter is a free developer utility that transforms JSON Schema Draft-04 through 2020-12 specifications into declarative Prisma schema models. It maps scalar types, required vs optional nullability, primary key strategies, enums, and relations 100% client-side in browser memory.

Universal Switcher:
From:
To:

100% Client-Side JSON Schema to Prisma Schema Converter

Zero Server Uploads

Transform JSON Schema definitions and OpenAPI models into production-ready Prisma schema models, standalone enums, relations, and auto-timestamps.

Local Browser Sandbox
Presets:
0 lines · 0 chars
0 models · 0 enums
0 Models 0 Enums
Client-Side Evaluated

Why Use This JSON Schema to Prisma Schema Converter?

100% Client-Side Privacy: Your JSON schemas and model contracts never leave your device.
Smart Inverted Nullability: Properties in required arrays map to mandatory fields, while omitted properties receive optional ? modifiers.
Automatic Identity Directives: Generates @id with autoincrement, uuid, or cuid strategies based on schema formats.
Dual-Sided Relations: Analyzes $ref pointers and arrays to synthesize @relation directives and foreign key fields.

How to Use JSON Schema to Prisma Schema Converter

1

Input JSON Schema

Paste your JSON Schema definition or load a pre-configured database preset.

2

Configure Directives

Select your datasource provider, ID strategy, and toggle auto-timestamps or relations.

3

Copy or Download

Copy the generated Prisma schema or download schema.prisma directly.

User JSON Schema to Prisma Model example

Converts a User JSON Schema into a Prisma model with a UUID primary key, required email, and optional bio.

JSON Schema Input Source
{
  "title": "User",
  "type": "object",
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "email": { "type": "string" },
    "bio": { "type": "string" }
  },
  "required": ["id", "email"]
}
Prisma Schema Output Processed
model User {
  id               String   @id @default(uuid())
  email            String
  bio              String?
}

Technical Specifications & Engine Details

Technical specifications and engine details for JSON Schema to Prisma Schema Converter
Specification Details
Supported JSON Schema Drafts Draft-04, Draft-07, Draft 2019-09, Draft 2020-12, OpenAPI 3.0/3.1
Supported Prisma Providers PostgreSQL, MySQL, SQLite, MongoDB, SQL Server, CockroachDB
Execution Mode 100% Client-Side In-Browser (Zero server latency)
Nullability Mapping Properties in required array → required, omitted → optional (?)
Synthesized Directives @id, @default(uuid()/cuid()/autoincrement()), @relation, @updatedAt
Maintained by Pragyan Pahadi

100% Client-Side Privacy Guarantee

Your files remain strictly on your local device. Zero data is transmitted to external servers.

Frequently Asked Questions

How does JSON Schema nullability translate to Prisma schema fields?
In JSON Schema, properties are optional unless declared in the parent required array. The converter maps required properties to non-nullable Prisma fields (e.g. name String) and omitted or null-union properties to optional Prisma fields with a question mark (e.g. bio String?).
How are primary keys generated in the Prisma model?
Fields named id or marked with primaryKey: true are assigned the @id directive. If the field is an integer, it receives @default(autoincrement()). If it has format: uuid, it receives @default(uuid()). Customizable ID strategies include auto, uuid, cuid, and autoincrement.
How are relations and foreign keys handled?
Properties referencing other models via $ref automatically generate scalar foreign key fields (e.g. authorId String) and Prisma @relation(fields: [authorId], references: [id]) annotations. Array references generate 1:N reverse relation arrays (e.g. items OrderItem[]).
Is any schema data sent over the network?
No. All JSON Schema parsing and Prisma code generation occur strictly in-memory within your browser. Zero data or telemetry is sent to any external server.

Methodology

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

Last updated .