Skip to main content

Prisma Schema Formatter

Format and beautify Prisma .prisma schema files — re-indent model/enum/datasource/generator blocks and column-align field names, types and attributes, Prisma format's signature look. Preserves // and /// doc comments, handles multi-line attribute values, and can reorder fields alphabetically or by type.

Input

Drop a file or browse
One file · text
Or

Formatting Options

Output

Formatted Schema
 
Was this helpful?

Guides

Paste a messy schema.prisma file and get back the clean, consistently indented, column-aligned schema that prisma format would produce — right in your browser, with nothing uploaded to a server. The Prisma Schema Formatter re-indents every model, enum, datasource, and generator block and, most recognizably, pads field names, types, and attributes into neat columns so a whole model reads like a table instead of a ragged list.

It's built for the moments you don't have the Prisma CLI handy: a schema pasted from a pull request, a snippet from documentation or an AI assistant with inconsistent spacing, a .prisma file dropped into a chat, or a quick tidy-up before committing a migration.

How to use it

  1. Paste your Prisma schema into the input box, or upload a .prisma file.
  2. Optionally choose a Field Sorting mode.
  3. Copy the formatted result, or download it as schema.prisma.

Formatting runs automatically as you type or change an option, so you see the result immediately.

What it does

  • Column alignment. Inside a model block, every field's name and type are padded to the widest name and widest type in that block, so @id, @unique, and every other attribute all start at the same column — the single most recognizable trait of prisma format's output.
  • Consistent 2-space indentation inside model, enum, datasource, and generator blocks (and Prisma's view/type blocks, which share the model grammar).
  • Comments survive untouched. Both // line comments and /// doc comments are preserved verbatim. A doc comment written directly above a field or block (no blank line in between) stays glued to it; one separated by a blank line keeps that separation, matching how Prisma treats documentation comments.
  • Multi-line attribute values collapse to one line. A @relation(...) or @@index(...) spread across several lines is reassembled into Prisma's canonical single-line form.
  • Blank lines are normalized. Runs of three or more blank lines collapse to one, and consecutive @@ block attributes (@@map, @@index, @@unique, …) are grouped under a single blank line rather than getting one each.
  • Field Sorting (optional, off by default): Preserve Original Order, Sort Alphabetically, or Group by Type (id fields, then scalar types, then enum/model references, then @relation fields — alphabetically within each group).

Privacy

Everything happens client-side in your browser. Your schema is never uploaded to a server — paste one with real table names or connection strings and it never leaves your machine.

Does this replace prisma format?

For everyday cleanup, yes — indentation, column alignment, comment handling, and blank-line normalization all match. It doesn't validate your schema against Prisma's full grammar or datamodel rules (unresolved references, invalid attribute combinations); use prisma validate for that.

Will it break my schema?

The formatter only reflows whitespace, blank lines, and attribute layout — it never changes a field name, type, or attribute argument. If it can't parse a block (a missing closing brace, for example), it reports the parse error instead of guessing.

What happens to datasource/generator config?

Keys like provider and url are aligned before their = the same way field names align in a model, and array values like previewFeatures = [...] are preserved.

prismaschemaformatterbeautifyormdatabaseprisma format

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/prisma-schema-formatter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prismaInput": "model User {\nid Int @id @default(autoincrement()…",
    "sortFields": "none"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `prisma-schema-formatter` tool (Prisma Schema Formatter) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.