Skip to content
toolstome

Database diagram (ER diagram) maker

Paste your schema's CREATE TABLE statements, from MySQL, PostgreSQL, SQLite or SQL Server, and get an entity-relationship diagram in seconds. Each table shows its columns and types, primary keys and foreign keys are marked, and lines connect every foreign key to the table it references, whether it's declared inline, as a table constraint or with ALTER TABLE. Drag tables to tidy the layout, hover a table to highlight its relationships, then export the diagram as PNG or SVG for documentation, or as DBML for dbdiagram.io.

Free · No sign-upProcessed in your browser

5 tables, 5 relationships

users🔑 idserialemailvarchar(255) *namevarchar(100)created_attimestampposts🔑 idserial↗ user_idinteger *titlevarchar(200) *bodytextpublishedbooleantags🔑 idserialnamevarchar(50) *post_tags🔑 post_idinteger🔑 tag_idintegercomments🔑 idserial↗ post_idinteger *↗ user_idintegerbodytext *

🔑 primary key · ↗ foreign key · * not null. Drag tables to arrange them.

The SQL is read in your browser only; it is never run or uploaded.

How to use the Database Diagram Maker

  1. 1

    Paste your SQL

    CREATE TABLE statements, for example from a schema dump or migration.

  2. 2

    Draw

    Tables and relationships are laid out in a grid.

  3. 3

    Arrange

    Drag tables, zoom with the wheel and drag the background to move around.

  4. 4

    Export

    Download PNG, SVG or DBML.

What is read from the SQL

Table and column names (with or without quotes, backticks or brackets and schema prefixes), column types, PRIMARY KEY (inline or as a table constraint), NOT NULL, UNIQUE, and foreign keys from REFERENCES, FOREIGN KEY constraints and ALTER TABLE … ADD FOREIGN KEY.

Comments are ignored and nothing is executed; the SQL is only read for its structure. Relations to tables that aren't in the pasted SQL are left out.

When to use it

  • Document a database for a README, wiki or handover.
  • Understand an unfamiliar schema quickly.
  • Review relationships in a migration before running it.

Limits

  • Only tables are drawn; views, triggers and indexes are ignored.
  • Very unusual dialect syntax may not be recognised; such columns are skipped.
  • Layouts aren't saved; export to keep the result.

Privacy

Runs entirely in your browser. Nothing you type or open is uploaded.

Frequently asked questions

How do I make an ER diagram from SQL?

Paste the CREATE TABLE statements and press Draw. Export the diagram as PNG or SVG.

How do I get the SQL of an existing database?

MySQL: mysqldump --no-data dbname. PostgreSQL: pg_dump --schema-only dbname. SQLite: .schema in the sqlite3 shell.

Are foreign keys detected automatically?

Yes, from inline REFERENCES, FOREIGN KEY table constraints and ALTER TABLE statements.

What is DBML?

Database Markup Language, the format used by dbdiagram.io. The export lets you continue editing there.

Does it run my SQL?

No. The SQL is only parsed in your browser to read the structure.

What do PK, FK and * mean?

The key icon marks primary keys, the arrow marks foreign key columns, and * marks columns that are NOT NULL.

People also use

Last updated November 30, 2026 · How we build and test our tools

Categories

Recently used tools

Tools you open will appear here.

More