SQL to ER Diagram
Home › Sequelize

Sequelize to ER Diagram

Paste your Sequelize model definitions and get an interactive ER diagram — tables, columns from DataTypes, and relations from associations.

Open the diagram tool →
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link
ER diagram of the Sequelize example schema: User and Post (2 tables, 1 relationship)
The Sequelize example below, drawn by the tool: User and Post (2 tables, 1 relationship).

At a glance

What it is
SQL to ER Diagram is a free, open-source browser tool that turns Sequelize models into an interactive entity-relationship (ER) diagram.
Input
Sequelize model definitions (JavaScript source).
Output
An interactive ER diagram you can rearrange, then export as PNG, SVG, Mermaid, DBML or PlantUML, or share as a link.
Cost
Free. MIT-licensed open source. No account or signup.
Privacy
Runs entirely in your browser. The schema is never uploaded, and share links carry the diagram in the URL fragment, which is not sent to a server.
Limits
It never connects to your database itself: you paste schema text, or run one read-only catalog query in your own client and paste the result. There are no accounts, so there is no real-time multi-user editing; diagrams are kept in your browser, as a saved file, or as a share link. Layout stays smooth at around 300 tables.

How it works

  1. Copy your Sequelize models (sequelize.define(...) or Model.init(...)).
  2. Paste them into the editor — Sequelize is auto-detected.
  3. Each model becomes a table; associations like belongsTo become relations.
  4. Arrange, hide tables, then export PNG/SVG or share a link.

Example

Sequelize models like this:

const User = sequelize.define('User', {
  email: { type: DataTypes.STRING, unique: true }
});

const Post = sequelize.define('Post', {
  title: DataTypes.STRING
});

Post.belongsTo(User);

…renders User and Post with a relation between them. Try it with your own →

Guide

Sequelize models can be defined three ways — sequelize.define('User', {...}), class User extends Model {} + User.init({...}), or the old sequelize.import — and this page reads all of them as plain text. Attribute names come from the object keys, types from the DataTypes values, and primaryKey: true, unique: true, allowNull: false are picked up as key/constraint badges.

Relations are drawn from your associations: Post.belongsTo(User) and User.hasMany(Post) both produce the same edge (the foreign key is what matters), belongsToMany through a model renders as many-to-many via the join table, and alias options like { as: 'author', foreignKey: 'author_id' } are respected when naming the edge.

An alternative that captures the real database: call await sequelize.sync({ logging: console.log }) once against a scratch database and paste the logged CREATE TABLE SQL instead. That shows exactly what Sequelize would build, including the join tables it creates implicitly for belongsToMany.

Why use it

SequelizePrismaSQLAlchemySQL

FAQ

How do I diagram Sequelize models?

Paste your sequelize.define or Model.init definitions. Columns come from DataTypes and relations from associations like belongsTo / hasMany.

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