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 →How it works
- Copy your
.dbmlfile or DBML snippet. - Paste it into the editor — DBML is auto-detected.
- Each
Tablerenders with its columns;Ref:and inline[ref: > …]become relations. - 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_id → users.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
Tableblocks with[pk, increment],[unique],[not null]and[default: …]settings.- Standalone
Ref: orders.customer_id > customers.idlines and inline[ref: > users.id]column settings — both one-to-many (>) and one-to-one (-). - Multi-column relations:
Ref: t.(a,b) > u.(a,b). Enumdefinitions attached to the columns that use them.
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
- Private: everything runs in your browser — nothing is uploaded or stored on a server.
- Round-trip: import DBML and export it back, or convert to Mermaid / PlantUML / SVG.
- Interactive: drag tables, auto-arrange, hide noise, add notes, and manually link columns.
- Free & open source — no account, no sign-up.
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.