ER diagram generator
Model your database as text and see the entity-relationship diagram render instantly. Define entities, attributes and cardinality in Mermaid — keys, one-to-many, many-to-many — all rendered locally.
One step per line. Indent two spaces to branch beneath the line above.
Cardinality at a glance
The crow’s-foot notation Mermaid uses encodes how many rows relate to how many: "||" means exactly one, "o{" means zero-or-many, "|{" means one-or-many. Reading "CUSTOMER ||--o{ ORDER" as “one customer places zero or many orders” makes the data model unambiguous for the whole team.
Add attribute blocks with PK/FK markers and the diagram doubles as lightweight schema documentation you can keep in the repo and review in a pull request.
Sketch a schema before you migrate
ER diagrams are the fastest way to think through a new feature’s tables or to document a database you inherited. Because it is text, you can iterate quickly — add an entity, re-render, and the layout reflows automatically without dragging boxes around.
Frequently asked questions
How do I make an ER diagram from text?
Start with "erDiagram", then write relationships like "CUSTOMER ||--o{ ORDER : places". Add attribute blocks with PK/FK markers to document keys. It renders live and exports to SVG or PNG.
How do I show one-to-many vs many-to-many?
Use crow’s-foot notation: "||--o{" is one-to-many, "||--||" is one-to-one, and "}o--o{" is many-to-many. The cheatsheet above lists each variant.
Can I mark primary and foreign keys?
Yes — inside an entity block, add "PK" after a primary-key attribute and "FK" after a foreign-key attribute, for example "int customer_id FK".
Is my schema uploaded to a server?
No. The diagram renders in your browser, so your table names and structure — which can be sensitive — never leave your device.
Can I turn this into real SQL?
This tool renders the model, not migrations. But an ER diagram is the clearest starting point for writing CREATE TABLE statements, and you can keep the Mermaid source beside them as documentation.