Home → JSON to Prisma Schema Generator
Generate Prisma ORM model definitions from any JSON object.
Generate Prisma ORM model definitions from any JSON object. This tool runs entirely in your browser — no data is ever sent to a server. Free to use, no account required.
Prisma schema is the single source of truth for your database model in Prisma ORM, describing models, fields, types, and relations.
Each model block maps to a database table. Fields have Prisma scalar types (String, Int, Float, Boolean, DateTime, Json) and optional attributes (@id, @unique, @default). The schema drives both database migrations and the generated TypeScript client.
One-to-one, one-to-many, and many-to-many relations are defined with @relation decorators. Prisma uses the relation to generate typed query methods (include, select, connect) in the client.
The converter infers a complete Prisma model definition from your JSON sample, including field types and nested relations.
JSON string → String, number → Int or Float, boolean → Boolean, object → related model with @relation, array of objects → one-to-many relation. Date strings are mapped to DateTime when they match ISO 8601 format.
The tool adds an id Int @id @default(autoincrement()) field following Prisma convention, and optional createdAt DateTime @default(now()) and updatedAt DateTime @updatedAt fields for audit tracking.
Prisma is a modern TypeScript ORM for Node.js and TypeScript. Its schema language defines database models with field types, relations, and constraints.
// JSON Sample
{
"id": 1,
"name": "Alice",
"email": "alice@example.com",
"age": 30,
"isActive": true,
"createdAt": "2024-01-01T00:00:00Z"
}
// Prisma Schema
model User {
id Int @id @default(autoincrement())
name String
email String @unique
age Int?
isActive Boolean @default(true)
createdAt DateTime @default(now())
@@map("users")
}
// datasource + generator
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
| JSON Type | Prisma Type | Notes |
|---|---|---|
| string | String | |
| integer | Int | or BigInt for large numbers |
| float | Float | or Decimal for precision |
| boolean | Boolean | |
| date string | DateTime | |
| nullable | Type? | Add ? for optional fields |
| array | Type[] | Requires list relation |
| JSON blob | Json | PostgreSQL native JSON |
Explore more tools: All JSON Tools | Validator | Pretty Print | JSON Diff