IQ
PayloadIQ
PayloadIQ Utilities

JSON to Prisma

Paste a JSON sample and get a Prisma schema model back — inferred scalar types, @id, @unique and createdAt/updatedAt, with the generator and datasource blocks. It all runs in your browser.

Prisma model appears here.

Runs in your browser. Your input is not uploaded to PayloadIQ.

JSON to Prisma turns a JSON sample into a Prisma model you can paste into your schema.prisma. It emits a model block with one field per key — scalar types inferred as Int, Float, String, Boolean or DateTime, and Json for nested objects and arrays — plus the generator and datasource blocks so you have a complete starting schema. Everything runs locally in your browser, so a real payload never leaves your machine.

Sensible defaults, ready to edit

An id becomes @id @default(autoincrement()), an email gets @unique, and every model gains createdAt / updatedAttimestamps — the conventions you'd add by hand. Set the model name with the Model-name field.

From scalars to relations

Inference is sample-driven and can't guess relations from one object, so nested objects and arrays land as Json; once the scalar fields are in place, model real relations with @relation yourself. Want types in another language, or seed SQL from the same payload? Try JSON to SQL or the PayloadIQ playground.

FAQ

Is my JSON uploaded?
No. The JSON is parsed and converted entirely in your browser with JavaScript — it never leaves your device. That makes it safe for real API responses, exports, and anything internal.
What does it generate?
A model { … } block with one field per key and an inferred scalar type (Int, Float, String, Boolean, DateTime, or Json for nested objects/arrays), plus the generator and datasource blocks so the output is a complete starting schema.prisma.
Which attributes are inferred?
An id field gets @id @default(autoincrement()); a field named email (or similar) gets @unique; and every model gets createdAt DateTime @default(now()) and updatedAt DateTime @updatedAt. Rename the model with the Model-name field.
How complete is the inference?
It is sample-driven, so paste a representative object. Nested objects and arrays become Json — Prisma can't infer a relation from a single sample — so once you have the scalars, model real relations with @relation yourself. The datasource defaults to postgresql; change the provider if you use MySQL/SQLite.

Related utilities

JSON to SQLJSON to TypeScriptJSON to ZodJSON Formatter / ValidatorJSON VisualizerJSON MinifierJSON DiffJSON to CSV
Open PayloadIQ Playground