Edit ER diagram

Model entities, attributes, and cardinalities in an entity-relationship diagram.

freeworks offlinenothing uploaded
ToolER Diagram Editor
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Entities become boxes with attributes, while relationship statements create connectors annotated with cardinality markers such as one-to-many. The renderer lays out the graph; the source remains a model of entities and relationships rather than a database migration.

  • Cardinality notation communicates relational structure without prescribing a SQL dialect.

Worked example

Blog Database
Generate an ER diagram for a blog database
Input
											Title: Blog Schema
Entities: [{"name":"User","attributes":[{"type":"int","name":"id","key":"PK"},{"type":"string","name":"email","key":"UK"},{"type":"string","name":"name","key":""}]},{"name":"Post","attributes":[{"type":"int","name":"id","key":"PK"},{"type":"int","name":"author_id","key":"FK"},{"type":"string","name":"title","key":""}]}]
Relationships: [{"from":"User","to":"Post","fromCardinality":"||","toCardinality":"}o","label":"writes"}]
										
Output
												erDiagram
    %% Blog Schema
    User {
        int id PK
        string email UK
        string name
    }
    Post {
        int id PK
        int author_id FK
        string title
    }
    User ||--}o Post : "writes"
											

When to use this

Schema reviews, data-model documentation, and migration planning edit ER diagrams.

Edge cases

  • A relationship endpoint naming an undefined entity cannot be resolved.
  • Optional and mandatory cardinalities use different markers.
  • An attribute label does not create a database constraint by itself.

References