Developer tools

Database Schema Diagram Generator

Paste one or more CREATE TABLE statements and get a laid-out SVG ER diagram, complete with primary keys, foreign key tags and relationship arrows.

Parsing and rendering happen locally — nothing you paste is sent anywhere.

📊

Tolerant parser

Reads inline and trailing PRIMARY KEY and FOREIGN KEY constraints across multiple CREATE TABLE blocks.

🔗

Visible relationships

Every foreign key gets an arrow pointing to the table and column it references.

Real SVG download

Export the diagram as a standalone .svg file you can drop into docs or a design tool.

How to use the database schema diagram generator

Turn raw DDL into a diagram you can actually show someone.

  1. Paste your CREATE TABLE SQLInclude as many tables as you like, in any order, in the text box.
  2. Generate the diagramThe parser extracts columns, primary keys and foreign keys and lays out a box per table.
  3. Download the SVGSave the diagram as a standalone SVG file for docs, wikis or design tools.

Reading the generated diagram

Each table becomes one rounded box listing its columns in the order they were declared. A handful of small markers carry most of the meaning, so the diagram stays readable even for a schema with a dozen tables.

PK columns

Primary key columns are shown in bold with a PK tag, whether they were declared inline or in a trailing PRIMARY KEY (...) constraint.

FK columns

Foreign key columns carry an FK tag, detected from an inline REFERENCES clause or a trailing FOREIGN KEY (...) REFERENCES constraint.

Relationship arrows

An arrow runs from each foreign key column to the primary key row of the table it references, when that table is present in the diagram.

Layout

Tables are arranged left to right in rows of three, in the order they appear in your SQL, sized to fit each one's own column list.

Database schema diagram generator FAQ

Questions about parsing, layout and exporting.

What SQL syntax does the parser understand?

It looks for CREATE TABLE name ( ... ) blocks, then reads each comma-separated column definition inside. It recognizes inline PRIMARY KEY and REFERENCES, as well as trailing PRIMARY KEY (col) and FOREIGN KEY (col) REFERENCES table(col) constraints. It is intentionally tolerant rather than a full SQL parser, so most dialects of MySQL, PostgreSQL and SQLite CREATE TABLE syntax will work.

What happens if a foreign key references a table I did not paste?

The referencing column is still tagged FK in its table box, but no arrow is drawn since there is no matching table box to point to. Paste all related CREATE TABLE statements together to see every relationship line.

How are the tables arranged in the diagram?

Tables are placed left to right in rows of three in the order they appear in your SQL, with each box sized to fit its own column list. This keeps the layout simple and predictable rather than trying to minimize crossing lines.

Can I edit the diagram after it is generated?

Not directly in this tool, but the downloaded SVG file is plain text markup that opens in any vector editor, such as Inkscape or Figma, for further styling or layout changes.

Is my schema sent to a server?

No. Parsing and diagram rendering happen entirely in your browser. Nothing you paste here is stored or transmitted.