ER Diagram Tool

Model entities, attributes and relationships.

places 1:N contains 1:N appears in 1:N customer PK id: uuid email: text created_at: timestamptz order PK id: uuid FK customer_id: uuid placed_at: timestamptz status: text order_item PK id: uuid FK order_id: uuid quantity: int product PK id: uuid sku: text price_cents: int

Try it: Sketch a shop database

  1. Start with the shop-schema template and identify the customer and order records.
  2. Add the fields you need and label primary and foreign keys explicitly.
  3. Check every relationship against the intended database before exporting.

This is a visual schema sketch. There is no database connection, SQL import or automatic validation of keys.

About ER Diagram Tool

A schema is far easier to reason about as a picture, and the relationships between tables are what a written schema hides.

Entity tables with typed attribute rows, primary and foreign keys, and cardinality.

The starting diagram is a shop schema: customer, order, order_item and product tables, each with a PK id row, joined by relationships labelled places 1:N, contains 1:N and appears in 1:N.

How ER Diagram Tool works in your browser

Entities are drawn as tables with one row per attribute and its type, which mirrors how the schema will actually be written and makes the diagram directly translatable into DDL.

The ER model tab offers Entity, Weak entity, Relationship and Attribute. Entity and Weak entity are the same table shape in different colours: the table name goes in Text and the columns in Rows (one per line), drawn in a monospaced font. A table does not grow as rows are added, so set its Height to fit.

Keys are marked explicitly. A foreign key is the relationship, so showing which column carries it — rather than only drawing a line between two boxes — is what makes the diagram usable when writing the migration.

PK and FK are typed as part of the row text. Nothing checks that a foreign key points at a real primary key, and there is no SQL import or export.

Cardinality on each relationship is the detail that changes the design. One-to-many and many-to-many produce different schemas, and leaving it off means the diagram cannot answer the question it was drawn for.

Connectors end in None, Arrow, Triangle, Diamond or Circle; there is no crow’s-foot marker, so write the cardinality in the connection Label, as the template does.

When to use it

  • Designing a database schema before creating any tables.
  • Documenting an existing database for people who have to query it.
  • Reviewing a proposed schema change with colleagues.
  • Mapping a schema containing commercially sensitive structure without a cloud tool.
  • Keeping a schema sketch as JSON so it can be updated when a migration changes it.

Frequently asked questions

Can I show cardinality properly?

As a label. Connectors end in an arrow, triangle, diamond or circle, and there is no crow's-foot symbol, so write the cardinality (1:N, N:M) on the connector or use a relationship diamond.

Can I record column types and keys?

Yes. Entities hold typed attribute rows with primary and foreign keys marked, so the diagram documents the schema rather than just the relationships.

How should I save it?

SVG for documentation that will be read, JSON if you expect to come back and edit the schema as it evolves.