SQL to ER Diagram
Home › DBML

DBML to ER Diagram

Paste DBML (Database Markup Language) and get an interactive ER diagram instantly. A free, in-browser DBML visualizer — import DBML, export PNG, SVG, Mermaid or PlantUML.

Open the diagram tool →
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link

How it works

  1. Copy your .dbml file or DBML snippet.
  2. Paste it into the editor — DBML is auto-detected.
  3. Each Table renders with its columns; Ref: and inline [ref: > …] become relations.
  4. Arrange, hide tables, then export PNG/SVG or convert to Mermaid/PlantUML.

Example

DBML like this:

Table users {
  id integer [pk]
  email varchar [unique]
}

Table posts {
  id integer [pk]
  user_id integer [ref: > users.id]
}

…renders two tables with a relation from posts.user_idusers.id. Try it with your own →

Guide

DBML (Database Markup Language) is the DSL behind dbdiagram.io, dbdocs and dbml-cli, and it was designed to be read by humans — which makes it a great input for a diagram. This page renders DBML the way dbdiagram does, but interactive: drag tables, hide the ones you don't care about, zoom, and export.

DBML syntax that's supported

Styling directives like headercolor and TableGroup blocks are safely skipped. If you're migrating off dbdiagram.io (pricing change, offline need, or you just want the data to stay local), paste your project here — the whole diagram renders client-side, and you can export back to SQL, Mermaid, PlantUML, PNG or SVG.

Why use it

DBMLMermaidPlantUMLSQLPrisma

FAQ

What is DBML?

DBML (Database Markup Language) is a simple, readable DSL for defining database schemas, popularized by dbdiagram.io. Paste it here to visualize it instantly.

Can I convert DBML to SQL or Mermaid?

Paste your DBML, then use Export to get Mermaid or PlantUML, or a PNG/SVG image of the diagram.

Is my schema uploaded anywhere?

No. Everything runs locally in your browser — your schema is never uploaded to or stored on any server.

Is it free?

Yes. It is completely free and open source, with no account or sign-up required.

Related