Mermaid ER diagram editor
Build entity-relationship diagrams in Mermaid and export them for schema reviews, database design, and data model documentation.
Use this page to connect a high-intent search query to the right problem-solution narrative.
A Mermaid ER diagram page for teams designing or documenting relational schemas.
View Mermaid sourcePlain-text diagram syntax — copy or edit directly.
1erDiagram2 USER ||--o{ ORDER : places3 ORDER ||--|{ LINE_ITEM : contains4 PRODUCT ||--o{ LINE_ITEM : referenced_in5 USER {6 string id PK7 string email8 string name9 }10 ORDER {11 string id PK12 string userId FK13 datetime placedAt14 }15 LINE_ITEM {16 string id PK17 string orderId FK18 string productId FK19 int quantity20 }21 PRODUCT {22 string id PK23 string name24 decimal price25 }Why use a Mermaid ER diagram
ER diagrams show entities, their attributes, and the relationships between them, including cardinality. They are a standard tool for database and data-model reviews.
- Entities with typed attributes
- Primary and foreign key hints
- One-to-many and many-to-many relations
Good fit for
Schema review threads, migration plans, data model onboarding, and any discussion that hinges on how records relate.
When to combine with a class diagram
Use an ER diagram for the storage model and a class diagram for the runtime model. Teams often keep both side by side in onboarding docs.