FREE · DIAGRAM TOOLS
ER Diagram Maker.
Draw entity relationship diagrams for database design with attributes, primary and foreign keys and crow’s foot cardinality.
How to use ER Diagram Maker
Start from a shop or blog schema. Declare each entity with its attributes and keys, link entities with one-to-one, one-to-many or many-to-many relationships, then export the ER diagram.
How it works
Relationships use crow’s foot notation: || means exactly one, o| zero or one, |{ one or more and o{ zero or more. The tool draws the model; it does not connect to a database or generate SQL. Rendering uses the open-source Mermaid library in your browser with its strict security level, so links, scripts and HTML in labels are disabled. Drafts are saved in this browser only; share links store the compressed code in the part of the URL after #, which browsers do not send to the web server. Exports contain only what you drew.
Example
CUSTOMER ||--o{ ORDER : places → one customer places zero or more orders.
What is an ER diagram?
An entity relationship diagram (ERD) describes the data a system stores: the entities, such as customers or orders, their attributes, and how entities relate to each other. Developers use ERDs to design a database schema before writing migrations, and to explain an existing schema to new team members.
This ER diagram tool draws the diagram from a compact text definition, using crow’s foot notation for cardinality.
Crow’s foot notation cheat sheet
A relationship is written LEFT <left marker>--<right marker> RIGHT : label. Each marker describes how many records can be on that side:
| Marker (left / right) | Meaning |
|---|---|
|o / o| | Zero or one |
|| / || | Exactly one |
}o / o{ | Zero or more |
}| / |{ | One or more |
CUSTOMER ||--o{ ORDER : places— one customer places zero or more orders.ORDER ||--|{ ORDER_ITEM : contains— every order contains at least one line.USER ||--|| PROFILE : owns— one-to-one.- Two dashes
--draw an identifying relationship (solid line); two dots..draw a non-identifying one (dashed line).
Attributes and keys
erDiagram
PRODUCT {
int id PK
string sku UK "Stock keeping unit"
decimal price
int category_id FK
}Each attribute line is a type, a name, optional keys — PK primary key, FK foreign key, UK unique — and an optional comment in quotes. Types are free text, so you can use the names of your database, such as varchar, uuid or timestamptz.
Design a database schema step by step
- List the nouns of your domain: customers, products, orders, invoices. Each becomes an entity.
- Give every entity a primary key and the attributes you really need.
- Draw the relationships and decide each cardinality by asking “can there be none? can there be many?” on both sides.
- Replace every many-to-many relationship with a junction entity, such as ORDER_ITEM between ORDER and PRODUCT, and add its foreign keys.
- Review names: singular entity names, consistent
snake_caseattributes and clear relationship labels. - Export the diagram for the design document and keep the source next to your migrations.
The diagram does not connect to a database and does not generate or import SQL. To create SQL inserts from sample data, see JSON to SQL and CSV to SQL.
Download SVG for documents, websites and slides that need sharp lines at any size, or PNG at 1× to 4× resolution for chat apps, tickets and tools that do not accept SVG. The background can match the theme, be white or be transparent.
Rendering happens in your browser with the open-source Mermaid library. Your code is not uploaded, drafts are kept in this browser’s local storage, and a share link stores the compressed diagram after the # sign, which browsers do not send to the web server.
Questions about ER Diagram Maker
How do I show a many-to-many relationship?
You can write A }o--o{ B : label for a conceptual model. For a physical database design, add a junction entity with two foreign keys and two one-to-many relationships.
Can I mark primary and foreign keys?
Yes. Add PK, FK or UK after the attribute name. Several keys can be combined with commas, for example PK, FK.
Can I generate an ER diagram from my existing database?
Not automatically. You can write the entities from your schema; the syntax is close to a table definition, so this is quick for small and medium schemas.
Which notation does the tool use?
Crow’s foot (Information Engineering) notation, the most common notation for database design.
Is my schema uploaded anywhere?
No. The diagram is rendered in your browser and nothing is sent to a server.
Is ER Diagram Maker free, and do I need an account?
Yes. This tool is free to use in your browser without an account. Processing takes place on your device.
What are the limits and what should I check?
Up to 50,000 characters of Mermaid code and 800 connections. PNG export up to 32 megapixels. Share links are limited to diagrams that compress to about 12,000 characters. Mermaid 11 syntax; no real-time collaboration or cloud storage. Review the result before using it in your work.
Is my input sent to a server?
Your input is processed in your browser and is not uploaded by this tool. Files and pasted text are cleared when the page is refreshed. Normal website requests are still required to load the page and its libraries. Read the privacy explanation.