1. Home
  2. Developer tools
  3. ER Diagram Maker

ER Diagram Maker

See how the tables in a schema connect, for a design review, documentation or a database course, straight from the SQL you already have.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use ER Diagram Maker

  1. Paste CREATE TABLE statements, or write Mermaid erDiagram text.
  2. Check the drawing; foreign keys become relationships.
  3. Download SVG or PNG, or copy the Mermaid source for a README.

Features

  • Primary, unique and foreign keys marked PK, UK and FK
  • Crow’s-foot cardinality from NOT NULL and UNIQUE constraints
  • Zoom, SVG and high-resolution PNG export
  • Mermaid source that renders on GitHub and GitLab
  • Works with PostgreSQL, MySQL and SQLite syntax

Supported formats

You can open

  • SQL
  • MMD

You get

  • SVG
  • PNG
  • MMD

Private by design

Your files are opened and processed by your browser on this device. They are never uploaded to openWorkstand or anyone else, so the ER Diagram Maker is safe for contracts, IDs, photos and work documents. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Layout is automatic; boxes cannot be dragged.
  • Very large schemas (dozens of tables) produce wide diagrams; split them by area.

Guide

Drawing entity-relationship diagrams from a SQL schema

An entity-relationship diagram shows the tables of a database as boxes and their foreign keys as lines. It is the quickest way to explain a schema to a new developer, check a design before building it, or document a database for a course or a client. Drawing one by hand in a diagram editor takes time and goes out of date the moment the schema changes. This tool draws it straight from the SQL.

From SQL to a diagram

Paste CREATE TABLE statements in PostgreSQL, MySQL or SQLite syntax. Each table becomes an entity box listing its columns with their types. Primary key columns are marked PK, foreign keys FK and unique columns UK. Every foreign-key column, whether declared inline with REFERENCES or in a separate FOREIGN KEY constraint, becomes a line from the referenced table to the table that holds the key, labelled with the column name.

How cardinality is chosen

The ends of each line use crow’s-foot notation, and the tool reads the constraints to decide which symbols apply. A foreign key that is also UNIQUE means each parent row can have at most one child, so the relationship is drawn as one to zero-or-one. A nullable foreign key means a child may exist without a parent, drawn as zero-or-one to many. A NOT NULL foreign key without uniqueness is the classic one-to-many, drawn as exactly one parent to zero or more children.

The Mermaid source

Behind every drawing is Mermaid erDiagram text, which is shown under the diagram. You can copy it into documentation that renders Mermaid, such as GitHub, GitLab, Notion or Obsidian, or switch to Mermaid mode and write or edit the text yourself, for example to add relationship labels like “places” or “contains”, or to sketch a design before any SQL exists.

A worked example

The Sample schema has four tables: users, products, orders and order_items. The generated source contains three relationships: users ||--o{ orders : "user_id", orders ||--o{ order_items : "order_id" and products ||--o{ order_items : "product_id". In the drawing, order_items shows both of its key columns marked PK and FK, because together they form its composite primary key. The PNG export of this diagram is about 170 KB.

Exporting

The SVG download is a vector file that stays sharp at any size and can be edited in Figma, Inkscape or Illustrator. The PNG is rendered at twice the on-screen size on a background that matches the current light or dark theme, which suits slides, tickets and chat messages. The zoom buttons only change the view, not the exported files.

When a generated diagram is not enough

The layout is computed automatically, so boxes cannot be dragged into position. For schemas with dozens of tables, split the SQL by area, such as billing or accounts, and draw each part separately; one huge diagram is hard to read anyway. Many-to-many relationships appear as two one-to-many lines through the join table, which is accurate for the database even if a conceptual model would draw a single line.

Reviewing a schema with the diagram

A diagram makes some design problems obvious: a table with no relationships at all, two tables that reference each other in a loop, or a foreign key drawn as zero-or-one where the business rule says every order must have a customer, which means the column should be NOT NULL.

Checked against the current version of the ER Diagram Maker on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

What do the symbols at the ends of the lines mean?

Crow’s-foot notation shows how many rows can be on each side. Two bars mean exactly one, a bar and a circle mean zero or one, and the three-pronged foot means many (with a circle, zero or many). ||--o{ therefore reads “one parent has zero or more children”.

Can I put the diagram in a GitHub README?

Yes, in two ways: download the SVG and commit it as an image, or copy the Mermaid source into a fenced code block marked mermaid. GitHub renders the second form itself, so the diagram stays editable as text.

How is a one-to-one relationship detected?

When the foreign-key column is also UNIQUE, each parent row can have at most one child, so the diagram draws one-to-zero-or-one instead of one-to-many.

Can I edit the diagram by dragging boxes?

No. The layout is computed automatically from the relationships, which keeps it in step with the schema. To change it, edit the SQL or switch to Mermaid text and reorder the entities.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.