SQL to ER Diagram
Home › DDL to ER Diagram

DDL to ER Diagram

Paste your database DDL — the CREATE TABLE and ALTER TABLE statements that define your schema — and get an interactive ER diagram with every table, column and foreign key drawn automatically.

Open the diagram tool →
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link

How it works

  1. Copy your DDL from a migration, schema dump, or your database client.
  2. Paste it into the editor — PostgreSQL, MySQL, SQLite, SQL Server, Oracle and Snowflake DDL all parse.
  3. Tables render with columns; inline REFERENCES and FOREIGN KEY constraints become relations.
  4. Arrange, hide tables, then export PNG/SVG or convert to Mermaid/DBML.

Example

DDL like this:

CREATE TABLE authors (
  id BIGINT PRIMARY KEY,
  name VARCHAR(120) NOT NULL
);

CREATE TABLE books (
  id BIGINT PRIMARY KEY,
  author_id BIGINT NOT NULL
);

ALTER TABLE books
  ADD CONSTRAINT fk_books_authors
  FOREIGN KEY (author_id) REFERENCES authors(id);

…renders two tables with a relation from books.author_idauthors.id, including the ALTER TABLE foreign key. Try it with your own →

Why use it

DDLPostgreSQLMySQLOracleSQL Server

FAQ

What counts as DDL?

Data Definition Language — the CREATE TABLE, ALTER TABLE and constraint statements that define your schema. Paste them and the diagram is drawn instantly.

Does it read ALTER TABLE foreign keys?

Yes — foreign keys added via ALTER TABLE … ADD CONSTRAINT … FOREIGN KEY (as pg_dump emits) are parsed and drawn as relations.

Is my schema uploaded anywhere?

No. Everything runs locally in your browser — your schema is never uploaded to or stored on any server.

Is it free?

Yes. It is completely free and open source, with no account or sign-up required.

Related