ChatDiagram
Tools/SQL to ER diagram generator

SQL to ER diagram generator.

Turn a SQL schema or a table description into an ER diagram. Paste the tables, columns and key relationships you want to document, then use the drawing to inspect how the schema fits together.

Entity-Relationship Diagram (ERD)Enter to send

Free account, no card · Export SVG, PNG or PDF

See it work

SQL to ER diagram examples.

Same tool, four requests. Every drawing below is a real render.

What you type
A database schema for users with User, Role, UserRole, Profile, Session, and AuditLog tables. Users have profiles and sessions, users receive roles through UserRole, and audit logs record user actions.
Then tryAdd an organization table for multi-tenancyAdd a password reset token table
Entity-Relationship Diagram (ERD): User and role schema
Entity-Relationship Diagram (ERD) · Chen 1976 / Everest 1976 (crow's foot) · schematex-erd

Rather start from a finished drawing? Browse 168 erd templates →

The drawing

What a SQL to ER diagram is.

A SQL to ER diagram turns table definitions into a picture of the data model. Tables become entities, columns become attributes, and primary and foreign keys make the relationships visible.

The drawing is useful for reading a schema at a glance. It does not run SQL or connect to a database; it represents the structure you describe or paste.

Standard
Chen 1976 / Everest 1976 (crow's foot)
Also follows
Implements the crow's-foot subset
Engine
schematex-erd
Editable
Double-click text, drag nodes
Export
SVG · PNG · PDF
Entity-Relationship Diagram (ERD): What a SQL to ER diagram is
Who uses it

Who uses SQL to ER diagrams.

Entity-Relationship Diagram (ERD): Application developersApplication developers

A compact view of inventory tables and their keys before implementing queries and screens.

Entity-Relationship Diagram (ERD): API designersAPI designers

A schema sketch for users, roles and types when planning the data behind an API.

Entity-Relationship Diagram (ERD): Database maintainersDatabase maintainers

Library tables and foreign keys documented for an existing system.

How it works

How to make an ER diagram from SQL in three steps.

01

Describe it

One paragraph is enough to start.

“A database schema for users with User, Role, UserRole, Profile, Session, and AuditLog tables. Users have profiles and sessions, users receive roles through UserRole, and audit logs record user actions.”
02

See the drawing

Drawn by the right engine.

Entity-Relationship Diagram (ERD): User and role schema
03

Say what changes

Every edit keeps a version.

Add an organization table for multi-tenancy
V2 · DRAWN FROM V1, NOTHING RETYPED
FAQ

Common questions

Can I create an ER diagram from SQL?

Describe or paste the table definitions, columns and key relationships, and the tool can draw the database structure as an ER diagram.

Does the tool execute my SQL?

No. The SQL or schema description is used as input for a drawing; it does not execute queries or connect to your database.

How are primary and foreign keys shown?

Primary keys identify a table's rows. Foreign keys are shown on the referencing table and connect it to the referenced table.

Which SQL dialect should I use?

Use familiar table and column definitions from the schema you are documenting. Make relationships and key columns explicit so the intended structure is clear.

Related tools

Other drawings for the same work.

Turn a schema into an ER diagram.

Free account, no card. Paste the tables or describe the relationships.

Open the editor