PDFPowerHub

DB Diagram

beta

This free DB diagram tool turns a schema written in DBML into a live entity-relationship diagram you can drag to arrange, then export as SQL for your database or as an image. Everything runs in your browser and your schema is saved locally, so nothing you design is ever uploaded.

Write your schema in DBML on the left; the ER diagram updates live. Drag tables to arrange them — your layout and schema are saved in your browser.

Saved
SQL dialect
Image
Scale
Loading diagram…

How to use DB Diagram

  1. 1 Write your schema in DBML in the left editor — the ER diagram updates live on the right.
  2. 2 Drag tables to arrange them, or drag column to column to add a relationship.
  3. 3 Pick a SQL dialect (PostgreSQL, MySQL, SQL Server, Oracle, SQLite or ClickHouse) and click Export SQL.
  4. 4 Export the diagram as a PNG, JPEG, WebP or SVG image, or save the project to reopen later.

Frequently asked questions

Is my database schema uploaded anywhere?

No. Parsing, diagramming and SQL generation all happen in your browser, and your DBML and layout are saved locally in your browser — nothing is sent to a server.

What SQL dialects can I export?

You can generate CREATE TABLE SQL for PostgreSQL, MySQL, SQL Server, Oracle, SQLite and ClickHouse, then copy it or download a .sql file.

Will I lose my work if I close the tab?

No. Your schema and table layout autosave in your browser, so they reload next time. You can also save a project file or export a .dbml to keep a portable copy.

How do I add a relationship between tables?

Either write a Ref line in the DBML, or drag from one table's column handle to another column on the canvas — the tool writes the matching Ref into your DBML automatically.