SQL to ER Diagram

Paste your SQL schema (CREATE TABLE statements) and get a clean, editable ER diagram with primary keys, foreign keys and relationships. Free to try.

How it works

  1. Paste your CREATE TABLE statements (Postgres, MySQL, SQLite...)
  2. draft1 reads columns, primary keys and foreign-key references
  3. Get an editable ER diagram with entities and 1-N relationships

Try it with this example

CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  email TEXT UNIQUE NOT NULL,
  created_at TIMESTAMP DEFAULT now()
);

CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  user_id INT REFERENCES users(id),
  status TEXT,
  total NUMERIC(10,2)
);

CREATE TABLE order_items (
  id SERIAL PRIMARY KEY,
  order_id INT REFERENCES orders(id),
  product_id INT,
  quantity INT
);
Generate this diagram free →

FAQ

Which SQL dialects work?

Postgres, MySQL, SQL Server, SQLite — anything with standard CREATE TABLE syntax.

Can it handle a big schema?

Yes — dozens of tables work. For 50+ table schemas, paste them by domain for the most readable diagrams.

Is the output editable?

Every ER diagram is a draw.io file you can edit by hand or by asking draft1 in plain English.