ER Diagram Online
Build entity-relationship diagrams visually in your browser. Add entities, attributes, and relationships with cardinality, then copy clean Mermaid erDiagram code.
Entities (4)
| Name | Type | Marker | Comment | |
|---|---|---|---|---|
| Name | Type | Marker | Comment | |
|---|---|---|---|---|
| Name | Type | Marker | Comment | |
|---|---|---|---|---|
| Name | Type | Marker | Comment | |
|---|---|---|---|---|
Relationships (3)
erDiagram
CUSTOMER {
int id PK
string email UK
string name
datetime created_at
}
ORDER {
int id PK
int customer_id FK
decimal total
string status
datetime placed_at
}
LINE_ITEM {
int id PK
int order_id FK
int product_id FK
int quantity
decimal unit_price
}
PRODUCT {
int id PK
string sku UK
string name
decimal price
}
CUSTOMER ||--o{ ORDER : "places"
ORDER ||--|{ LINE_ITEM : "contains"
PRODUCT ||--o{ LINE_ITEM : "appears in"Example
Online ER diagram example
A Mermaid ER diagram for users, diagrams, and generated exports.

Mermaid code
erDiagram
USER ||--o{ DIAGRAM : creates
DIAGRAM ||--o{ EXPORT : produces
USER {
string id
string email
}
DIAGRAM {
string id
string mermaid_code
string diagram_type
}
EXPORT {
string id
string format
}How to build an ER diagram online
Add an entity for each table or domain object you want to model.
Define attributes with type and PK/FK/UK markers as needed.
Connect entities with relationships and pick the cardinality on each side.
Copy the generated Mermaid code or export the preview to PNG or SVG.
คำถามที่พบบ่อย
What is an ER diagram?
An entity-relationship (ER) diagram is a visual model of data: rectangles for entities (tables), attributes inside each entity, and lines showing how entities relate. Mermaid's erDiagram syntax encodes the same model in plain text.
Which cardinalities are supported?
All four standard Mermaid cardinalities are supported: exactly one, zero or one, one or more, and zero or more. Each side of the relationship can be set independently to express one-to-one, one-to-many, and many-to-many.
Can I import an existing schema?
If you already have SQL CREATE TABLE statements, use the SQL to Mermaid ERD Converter to generate a starting point, then refine it here. We're working on a direct schema import for this builder.
Is anything uploaded to a server?
No. The whole tool runs in your browser. Your model never leaves your device.