Skip to content
M2TOOLKIT

ERD Diagram Maker

Design your database visually — tables, keys and relationships — and get the SQL to match.

  • Free
  • No sign-up
  • Nothing is sent or stored
Loading editor…

Shortcuts and tips

Drag from a blue dot
Connect two shapes
Drop a connector on empty space
Create a new connected shape
Double-click
Edit text · add a shape on empty canvas
Shift + click / drag a box
Select several
Alt + drag
Duplicate while moving
Space + drag · two fingers
Pan
Ctrl + scroll · pinch
Zoom
Ctrl Z / Ctrl ⇧ Z
Undo / redo
Ctrl C / X / V
Copy / cut / paste
Ctrl D
Duplicate
Ctrl A
Select all
Delete
Delete selection
Arrow keys (Shift for 10px)
Nudge
Enter
Edit selected
+ / − / 0
Zoom in / out / fit
V / H
Select / pan tool
Drag a column dot onto a table
Create a foreign key
Enter in search
Jump to the next match

Start from a database template

Each template is a real, normalised schema you can adapt. Your current diagram is replaced, but you can undo.

Import SQL or a saved diagram

Paste CREATE TABLE statements from PostgreSQL, MySQL, SQLite or SQL Server. Keys, foreign keys, unique columns, defaults, indexes and CHECK constraints are read; the diagram is laid out automatically.

SQL script

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved.

How to use the ERD Diagram Maker

  1. Start from a template (blog, e-commerce, SaaS, school and more), import your existing CREATE TABLE statements, or add tables yourself.
  2. Add columns with types and flags (PK, NN, UQ, auto-increment). Drag a key onto another table to create the foreign key and relationship.
  3. Set cardinality and ON DELETE rules on each line, then export the diagram (PNG, SVG, PDF) or the SQL for PostgreSQL, MySQL, SQLite or SQL Server.

What does this tool do?

Relationships use crow's-foot notation, so one-to-one, one-to-many and many-to-many are clear at a glance — and a many-to-many line can be turned into a proper junction table in one click. Lines attach to the exact columns they join and reroute as you move tables, with auto-layout, snap-to-grid, alignment guides, search and full undo.

Everything runs in your browser: your schema is never uploaded, and it saves automatically as you work. Import reads primary and foreign keys, unique columns, defaults, indexes and CHECK constraints from your SQL.

Why use it?

  • Keys, indexes and constraints.
  • Crow's-foot relationships.
  • SQL import and export.
  • Free, private, no sign-up.

Privacy

The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.

Frequently asked questions

What is an ERD?

An entity relationship diagram shows the tables in a database, their columns and how they relate — for example, one customer has many orders. It's the standard way to plan and document a database.

How do I create a foreign key?

Drag the dot next to a primary key onto another table and the matching foreign-key column is added for you, or choose “References …” in a column's settings.

Can I import an existing database?

Paste CREATE TABLE (and ALTER TABLE / CREATE INDEX) statements from PostgreSQL, MySQL, SQLite or SQL Server. Tables, keys, relationships, defaults, indexes and CHECK constraints are read and laid out automatically.

How do I show a many-to-many relationship?

Click a line and set it to many-to-many. To implement it in a real database, choose “Create junction table” and the tool adds a linking table with two foreign keys.

Which SQL dialects can I export?

PostgreSQL, MySQL/MariaDB, SQLite and SQL Server, including auto-increment syntax, foreign keys with ON DELETE/ON UPDATE rules, indexes and CHECK constraints.

Is my schema private?

Yes. The editor runs entirely in your browser and saves to this device only. Export a .json file to keep a copy or move it to another computer.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the erd diagram maker.