🌐 English

Home › Data

SQL to ERD (ER Diagram Generator)

See your database design as a diagram. Paste CREATE TABLE statements; tables and relationship lines are laid out automatically.

How to write it
  • CREATE TABLE name ( column type …, … ); — as many as you like
  • Inline PRIMARY KEY / REFERENCES other_table(column) are read
  • PRIMARY KEY (a, b) · FOREIGN KEY (a) REFERENCES table(column) also work
  • -- and /* */ comments are skipped
  • INDEX, CHECK and UNIQUE lines aren't drawn

🔒 Your text never goes to a server — diagrams are drawn on your device (in your browser) and saved only in this browser.

How to use

  1. Paste your CREATE TABLE statements (several at once).
  2. Check primary keys, foreign keys and the relationship lines.
  3. Download PNG or SVG for your design docs.

Reading an ERD

Each box is a table and each row a column. A PK holds a unique value per row; an FK points to another table's PK.

On the relationship line, the crow's foot (three prongs) means “many” and the double bar means “one” — for example, one user can have many orders.

Which SQL is supported

Standard CREATE TABLE statements used by most databases, including quoted or bracketed names, schema-qualified names (public.users) and composite primary keys. Only the pasted text is read — nothing connects to a database.

FAQ

Does it connect to my database?

No. It reads only the text you paste.

I don't see relationship lines

Lines need REFERENCES or FOREIGN KEY, and the referenced table must be pasted too.

What about keys added with ALTER TABLE?

Only keys inside CREATE TABLE are read for now.

Is my text uploaded?

No. Everything is drawn in your browser.