SQL to ER Diagram

Paste your CREATE TABLE statements and watch the ER diagram draw itself: tables, columns, primary and foreign keys, and the relationships between them. Convert it to Mermaid, Prisma or another SQL dialect, or open it as an editable board.

  • Paste SQL from PostgreSQL, MySQL, SQL Server or SQLite
  • Tables, columns, types, primary keys, foreign keys, NOT NULL, UNIQUE and defaults
  • Foreign keys (inline, FOREIGN KEY or ALTER TABLE) drawn as relationships
  • Convert the schema to Mermaid erDiagram, Prisma or another SQL dialect
  • Open it as an editable ER board to rearrange, present and share
  • Free, no sign-up, nothing uploaded: runs in your browser

Frequently asked questions

How do I generate an ER diagram from SQL?

Paste your CREATE TABLE statements into the box. The tool reads every table, column and foreign key and draws the entity relationship diagram straight away. You can paste a whole schema dump (for example from pg_dump --schema-only or mysqldump --no-data).

Which databases are supported?

PostgreSQL, MySQL and MariaDB, SQL Server and SQLite CREATE TABLE syntax, including SERIAL and AUTO_INCREMENT columns, composite primary keys, inline REFERENCES, FOREIGN KEY clauses and ALTER TABLE … ADD FOREIGN KEY.

Is my schema uploaded anywhere?

No. The SQL is read and drawn in your browser, and no AI is involved. Nothing leaves your computer unless you choose to save it as a board in your account.

Can I convert SQL to Mermaid or Prisma?

Yes. Switch to the Mermaid tab for erDiagram code you can paste into GitHub, GitLab or Notion, the Prisma tab for a schema.prisma, or the SQL tab to rewrite the schema for PostgreSQL, MySQL, SQL Server or SQLite.

Is it free?

Yes, the SQL to ER diagram tool is free with no sign-up. Opening the diagram as a board is free too; Pro adds unlimited AI on ER boards (for example "add an audit log table") and clean PDF, SVG and PowerPoint exports.

Try AI Flowchart free →