JSON to Prisma Schema
JSON to Prisma Schema Generator
Paste a JSON object and get a Prisma model block with inferred field types. Handles strings, integers, floats, booleans, ISO date strings (typed as DateTime), and nested objects (typed as Json). Auto-detects the @id field and adds one if missing. Runs entirely in your browser.
Where Is This Useful?
schema.prisma in seconds.How to Use
- Paste a JSON object in the input panel (not an array — Prisma models describe one record)
- Set the model name (defaults to Model)
- Click Generate Model or press Ctrl+Enter
- Copy and paste the
modelblock into yourschema.prismafile - Add
@unique,@default, relations, and other attributes as needed
Type Mapping
- JSON string →
String - ISO date string →
DateTime - JSON integer →
Int - JSON float →
Float - JSON boolean →
Boolean - JSON null →
String?(nullable) - JSON object or array →
Json idor_idfield → annotated with@id
Frequently Asked Questions
What Prisma types does this tool generate?
It generates String, Int, Float, Boolean, DateTime, and Json. Strings matching ISO date patterns are typed as DateTime.
Does it detect the @id field?
Yes. If your JSON has an id or _id field, it gets the @id attribute. If no id field is present, an auto-incremented id Int @id @default(autoincrement()) is added.
Is the output ready to paste into schema.prisma?
The model block is ready to paste. You still need datasource and generator blocks at the top of your schema file if you don't have them yet.
How is this different from JSON to Mongoose?
Mongoose is for MongoDB with Node.js and generates JavaScript schema code. Prisma is a modern ORM targeting SQL databases (PostgreSQL, MySQL, SQLite) and generates a declarative schema file.
Is my JSON uploaded anywhere?
No. Everything runs locally in your browser. Your data never leaves your machine.
Related Tools