How to use the ERD Maker
- Start blank, paste CREATE TABLE statements (Import SQL), paste DBML, or pick one of twelve schema templates.
- Add tables (T) and columns with types and flags — primary key, not null, unique, auto-increment, index, default and comment.
- Drag the dot beside a key column onto another table to create the foreign key and relationship. Set each end's cardinality with crow's-foot notation.
- Run Validate Schema, then Generate SQL for PostgreSQL, MySQL, SQL Server or SQLite — or export DBML, PNG, SVG, PDF or a project file.
What does this tool do?
An entity relationship diagram (ERD) shows the tables in a database, their columns and keys, and how rows in one table relate to rows in another. This editor draws them with crow's-foot notation: each end of a line shows exactly one, zero or one, one or many, or zero or many. Lines attach to the exact columns they join and re-route as you move tables.
SQL import reads CREATE TABLE, ALTER TABLE … ADD CONSTRAINT, CREATE INDEX and COMMENT ON from PostgreSQL, MySQL/MariaDB, SQL Server (including GO batches and [brackets]) and SQLite. It picks up primary and foreign keys, unique and not-null constraints, defaults, auto-increment and identity columns, and indexes. If the SQL can't be parsed — an unclosed bracket or quote, or a table without a column list — you get the line number instead of a half-drawn diagram.
Generate SQL writes tables in dependency order with each database's own auto-increment syntax and type names, and adds foreign keys that form a cycle afterwards with ALTER TABLE. Smart relationships spots columns such as orders.user_id and offers users.id → orders.user_id with one click. A searchable outline finds any table or column, and five auto-layouts (hierarchical, left-to-right, top-to-bottom, compact and relationship-optimised) keep large schemas readable.
Everything runs in your browser and saves automatically on this device. Nothing about your schema is uploaded.
Why use it?
- Crow's-foot relationships with per-end cardinality and ON DELETE / ON UPDATE rules.
- SQL → ERD import for PostgreSQL, MySQL, SQL Server and SQLite, with clear error messages.
- ERD → SQL for four dialects, plus DBML import and export.
- Smart relationship suggestions, schema validation and one-click junction tables.
- Twelve templates and five auto-layouts for large schemas.
- PNG, SVG, PDF and project-file export. Free, private, no sign-up.
Use cases
- Planning a new application's database before writing migrations.
- Documenting an existing database: paste a schema-only dump and export a diagram for the wiki.
- Database coursework: normalisation exercises, one-to-many and many-to-many relationships, junction tables.
- Reviewing a schema change with your team using a shareable PNG, SVG or PDF.
Example: from SQL to diagram and back
Paste this and choose Create diagram:
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE
);
CREATE TABLE orders (
id SERIAL PRIMARY KEY,
user_id INT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
total DECIMAL(10,2) NOT NULL
);You get two tables joined by a one-to-many line: exactly one user at the users end, zero or many orders at the orders end. Generate SQL for MySQL turns SERIAL into INT AUTO_INCREMENT; for SQL Server it becomes INT IDENTITY(1,1), and for SQLite INTEGER PRIMARY KEY AUTOINCREMENT.
| Crow's-foot end | Means | Typical use |
|---|---|---|
| Two bars | Exactly one | The parent side of a NOT NULL foreign key |
| Circle + bar | Zero or one | An optional parent, or a one-to-one child |
| Bar + crow's foot | One or many | A parent that must have at least one child |
| Circle + crow's foot | Zero or many | The usual child side of one-to-many |
Common mistakes
- Drawing a many-to-many line and expecting it to become SQL. Relational databases need a junction table — select the line and choose Create junction table.
- Giving a foreign key a different type from the key it references (INT vs BIGINT or UUID). Validate Schema flags type mismatches.
- Forgetting a primary key on a table. Every table should have one, even if it's a composite key on a junction table.
- Using ON DELETE SET NULL on a NOT NULL column — the database will reject it.
- Marking a one-to-one relationship without making the foreign key unique, which still allows many rows.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Frequently asked questions
What is an ERD?
An entity relationship diagram shows the tables (entities) in a database, their columns and keys, and the relationships between them — for example, one customer has many orders. It's the standard way to plan, document and review a database design.
Can I turn my SQL into an ER diagram?
Yes. Choose Import SQL and paste CREATE TABLE statements — for example the output of pg_dump --schema-only, mysqldump --no-data or “Script table as CREATE” in SQL Server Management Studio. Tables, keys, relationships and indexes are read and laid out automatically. Data (INSERT statements) is ignored.
Which databases can it generate SQL for?
PostgreSQL, MySQL/MariaDB, SQL Server and SQLite. Types and auto-increment syntax are translated for each — for example BOOLEAN becomes BIT on SQL Server, and UUID becomes CHAR(36) on MySQL.
What is crow's-foot notation?
A way of drawing cardinality at each end of a relationship line: a bar means one, a circle means zero (optional), and a three-pronged “crow's foot” means many. Combined, they show exactly one, zero or one, one or many, and zero or many.
Does it support DBML?
Yes. Import DBML (the schema language used by dbdiagram.io) including tables, column settings, indexes blocks and Refs, and export your diagram as DBML.
What happened to the ERD Diagram Maker?
It has been replaced by this ERD Maker, and the old address redirects here. Diagrams saved by the old tool in this browser open here automatically the first time you visit.
Is my schema private?
Yes. The editor runs entirely in your browser and saves to this device only. Nothing about your tables or SQL is uploaded.
Last reviewed by the M2Toolkit team.