TypeORM to ER Diagram
Visualize your TypeORM entities as an interactive ER diagram. Paste the entity classes as they are — @Entity, @Column, @ManyToOne and @ManyToMany are read directly — or paste the SQL TypeORM generates if you want every database-level detail.
At a glance
- What it is
- SQL to ER Diagram is a free, open-source browser tool that turns TypeORM entities into an interactive entity-relationship (ER) diagram.
- Input
- Decorator-style TypeORM entity classes (
@Entity,@Column,@ManyToOne,@ManyToMany…),EntitySchemadefinitions, or the SQL TypeORM generates from them. - 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
- Copy your entity classes — one file or several pasted together.
- Paste them into the editor (or drop the
.tsfile on the page). TypeORM is detected automatically. - Each
@Entitybecomes a table;@ManyToOne/@OneToOnebecome foreign keys and@ManyToManywith@JoinTablebecomes a junction table. - Arrange, hide tables, then export PNG/SVG or convert to Mermaid/DBML.
Example
Paste TypeORM entities like these:
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: number;
@Column({ unique: true })
email: string;
}
@Entity()
export class Post {
@PrimaryGeneratedColumn()
id: number;
@Column()
title: string;
@ManyToOne(() => User)
author: User;
}
…and you get User and Post with a relation from Post.authorId → User.id. Try it with your own →
Guide
TypeORM entities are decorators over classes — @Entity(), @PrimaryGeneratedColumn(), @Column(), @ManyToOne(() => User, u => u.posts) — and while this page works from the SQL TypeORM generates, that's the more reliable path anyway: the generated SQL is the ground truth of what's in your database, including column types resolved from your database driver, explicit constraint names, and join tables created by @ManyToMany(() => Tag, tag => tag.posts).
The two easiest ways to get that SQL:
- Migrations:
npx typeorm migration:generate -d ./migrations MyFirstMigration, then paste theCREATE TABLEstatements from the generated file. - Synchronize logging: set
logging: truein your DataSource options (orsynchronize: truein dev) and copy the schema-sync SQL from the console at startup.
Both produce standard Postgres/MySQL DDL with ALTER TABLE … ADD CONSTRAINT foreign keys, which the parser stitches back onto the right tables. NestJS projects work identically — the entities are plain TypeORM under the hood.
Why use it
- Private: everything runs in your browser — nothing is uploaded or stored on a server.
- Straight from code: no migration run and no database needed — the entity decorators are read as they are.
- Interactive: drag tables, auto-arrange, hide noise, add notes, and manually link columns.
- Export a high-res PNG, vector SVG, or the schema as Mermaid / DBML / PlantUML code.
- Free & open source — no account, no sign-up.
FAQ
How do I get an ER diagram from TypeORM?
Paste your entity classes into the editor. Every class marked @Entity becomes a table, its @Column properties become columns, and its relations become foreign keys.
Which TypeORM features are read?
Decorator-style entities: @Entity, @PrimaryGeneratedColumn, @PrimaryColumn, @Column, the date and version columns, @ManyToOne, @OneToOne with @JoinColumn, and @ManyToMany with @JoinTable. EntitySchema definitions are read too. For exact database types, paste the SQL from typeorm migration:generate instead.
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.