Database Diagram Tools Compared: Free Options That Read Your Live Database
For developers and analysts who need a diagram of a database that already exists, and want a free tool that draws it from the database.
On this page
You have to change a database that someone else designed, and nobody has a current picture of its tables. A database diagram tool draws each table as a box with its columns, and each foreign key as a line between two boxes. For a database that already exists, choose DbSchema. Its free Community Edition connects to the database and reverse-engineers the tables and foreign keys into a diagram that you can edit.
pgAdmin, DBeaver and MySQL Workbench read a database too, and ChartDB, Lucidchart, dbdiagram.io and DrawSQL draw from a query result, code or a script. Every vendor fact below was checked on the vendor's own site on 12 November 2026.
Where the diagram comes from
A diagram tool gets its tables in one of three ways:
- It connects to the database and reads the catalog, where the database describes its own tables, keys and constraints. DbSchema, pgAdmin, DBeaver and MySQL Workbench work this way.
- It gives you a query to run on the database, and you paste or upload the output. ChartDB and Lucidchart work this way.
- It draws what you type or paste, such as code in its own format or a SQL script. dbdiagram.io and DrawSQL work this way.
The way decides whether the diagram matches the database you run. A diagram made from a query result or a pasted script shows the schema on the day someone copied it. After a migration, it stays as it was until someone copies the schema again. A tool that connects reads the current schema each time you reverse-engineer the database.
The tools compared
DbSchema comes first, then the other tools that connect, then the tools that import a query result, then the tools that draw from code or a script.
| Tool | Gets the tables from | Databases | Free edition |
|---|---|---|---|
| DbSchema | A connection to the database | 100+ SQL and NoSQL databases | Community Edition, with editable diagrams |
| pgAdmin ERD Tool | A connection to the database | PostgreSQL, EDB Postgres Advanced Server | Free and open source |
| DBeaver | A connection to the database | The databases DBeaver connects to | Community Edition, with read-only diagrams |
| MySQL Workbench | A connection to the database | MySQL | Community Edition, under the GPL |
| ChartDB | The output of a query you run | PostgreSQL, MySQL, SQL Server, MariaDB, SQLite, CockroachDB, ClickHouse | 1 database of up to 10 tables |
| Lucidchart | The output of a query you run | MySQL, Oracle, PostgreSQL, SQL Server and others | 3 editable documents |
| dbdiagram.io | DBML code you type, or a SQL script | PostgreSQL, MySQL, SQL Server, Snowflake, BigQuery through its dbdocs tool | Up to 10 diagrams and doc projects |
| DrawSQL | A SQL dump you upload or paste | MySQL, PostgreSQL, SQL Server | Public diagrams of up to 15 tables |
pgAdmin and MySQL Workbench each read one family of databases, and DBeaver Community draws read-only diagrams. DbSchema Community reads 100+ databases and changes tables from the diagram.
DbSchema reads the database and draws it
DbSchema is a desktop application for Windows, macOS and Linux, and connects to the database from your computer. DbSchema connects through a JDBC driver, and downloads the driver the first time you connect. The steps are in connect to a database:
- Choose File → New Model.
- Keep Connect to Database selected, and click your database, such as PostgreSQL.
- Choose New Connection, and press Connect to PostgreSQL.
- Fill in the host, the user and the database, and press Connect.
- In Reverse Engineer the Database, tick the schemas to import and press Load.
DbSchema draws the imported tables in a new model, its own copy of the schema. Importing reads the database and changes nothing in it.
Read the lines before you write a join
Each foreign key is a line, and the line shows whether the child column accepts NULL. Take three tables:
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
name VARCHAR(50) NOT NULL
);
CREATE TABLE coupons (
coupon_id INT PRIMARY KEY,
code VARCHAR(20) NOT NULL
);
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_id INT NOT NULL REFERENCES customers (customer_id),
coupon_id INT REFERENCES coupons (coupon_id)
);
The line from orders to coupons is dashed, because coupon_id accepts NULL. An order may have no coupon. The line to customers is solid, because customer_id is NOT NULL. Both lines end in a crow's foot at orders, because neither column is unique: one customer can have many orders. The foreign keys documentation lists every case.
A dashed line tells you that an inner join along it can drop rows. Add two orders, one of them without a coupon, and join the three tables:
INSERT INTO customers VALUES (1, 'Ana'), (2, 'Ben');
INSERT INTO coupons VALUES (10, 'SPRING');
INSERT INTO orders VALUES (100, 1, 10), (101, 2, NULL);
SELECT o.order_id, c.name, p.code
FROM orders o
JOIN customers c ON c.customer_id = o.customer_id
JOIN coupons p ON p.coupon_id = o.coupon_id;
Order 101 has no coupon, so the inner join drops it:
| order_id | name | code |
|---|---|---|
| 100 | Ana | SPRING |
Join along a dashed line with LEFT JOIN, and order 101 comes back with an empty code. Both joins were run on PostgreSQL 18.6 and SQLite 3.50.
Change the tables on the diagram
Editing the diagram is different. When you press OK in a table or foreign key dialog while DbSchema is connected, the change runs in the database at once. Right-click the diagram and choose Create Table to add a table. Double-click a table header to edit its columns and indexes. Drag a column onto a column of another table to create a foreign key (tables and columns).
If a database declares no foreign keys, its diagram has no lines. Drag the child column onto the parent column anyway, and tick Virtual in the dialog. DbSchema draws the virtual foreign key and never creates it in the database. Model → Find Virtual Foreign Keys suggests them between columns with matching names.
For a database that doesn't exist yet, choose Design from Scratch on the start screen, and create the database later. Saving the model as a file keeps its virtual foreign keys and diagrams, and needs DbSchema Pro. File → Git Collaboration then works with the saved file in a Git repository (Git collaboration).
Split a large schema into several diagrams
On one diagram of every table, the tables you work on get lost among the rest. A DbSchema model holds as many diagrams as you need. Choose Diagram → New Diagram for each part of the application, such as orders or inventory, and a table can show on several of them. Diagram → Create Group of Tables draws a named box around tables that belong together. Diagram → Auto Arrange Tables lays the tables out by their foreign keys (diagrams).
What the Community Edition covers
The DbSchema Community Edition is free. Community connects to every database that DbSchema supports, reverse-engineers the database, draws and edits the diagrams, and runs the SQL editor. A new installation starts as a 15-day trial of DbSchema Architect, and becomes Community when the trial ends. Pro adds the model file, schema synchronization (comparing the model with a database), the Query Builder, the Data Explorer and the data generator. Architect adds logical and conceptual design (edition comparison).
pgAdmin, DBeaver and MySQL Workbench also connect to the database
pgAdmin's ERD Tool opens on a PostgreSQL database, a schema or a table. You can add tables and relationships on the diagram. Generate SQL then writes the CREATE TABLE statements into the Query Tool, and the database changes only when you run it. pgAdmin is free and open source under the PostgreSQL licence, and works with PostgreSQL and EDB Postgres Advanced Server.
DBeaver Community, under the Apache 2.0 licence, opens an ER diagram on a table, view or schema of a connected database. The diagram is read-only by default. Its Edit mode, which turns changes on the diagram into a SQL script, is in DBeaver Enterprise and Ultimate only. DBeaver ER diagrams and where they fall short covers DBeaver in detail.
MySQL Workbench Community Edition is free under the GPL. Database → Reverse Engineer reads a running MySQL server and places the tables on an EER (enhanced entity-relationship) diagram (reverse engineering a live database). MySQL Workbench 26 has replaced Workbench 8.0, which gets no new releases.
ChartDB and Lucidchart import the output of a query
ChartDB gives you one query to run on your database. You paste the query's JSON output into ChartDB, and ChartDB draws the diagram. ChartDB never asks for the database password (ChartDB on GitHub). The free plan on ChartDB's cloud covers one database of up to 10 tables (ChartDB pricing). ChartDB's code is open source under the AGPL, and can run on your own server.
In Lucidchart's ERD import, you pick your database system, copy Lucid's query, run it, and upload or paste the output (Lucid's ERD help). Lucidchart can export the diagram as SQL, without the relationship lines between tables. Lucid's database diagram page names MySQL, Oracle, PostgreSQL and SQL Server among the systems it supports, and the free plan includes 3 editable documents.
dbdiagram.io and DrawSQL draw from code or a script
dbdiagram.io draws the diagram from DBML, a text format for tables and references that you type. It also imports SQL scripts. To start from a live database, its command-line tool dbdocs generates DBML from PostgreSQL, MySQL, SQL Server, Snowflake or BigQuery on your own computer (generate DBML from a database). The free plan holds up to 10 diagrams and doc projects (dbdiagram.io pricing).
DrawSQL imports a schema-only SQL dump of MySQL, PostgreSQL or SQL Server, which you upload or paste (DrawSQL import). The free plan has unlimited public diagrams of up to 15 tables, and no private ones (DrawSQL pricing).
Download DbSchema, connect it to the database you need to understand, and reverse-engineer it into a diagram. Read the dashed lines before you write the joins. Connecting, the diagrams, editing tables and the SQL editor are in the free Community Edition. Saving the model file needs DbSchema Pro, which the 15-day trial includes.
Frequently asked questions
Can a database diagram tool create the database as well as draw it?
DbSchema creates each table in the database when you press OK in its dialog while DbSchema is connected. A design made without a connection reaches the database through schema synchronization, which compares the model with the database and needs DbSchema Pro.
How do I share a diagram with people who don't run DbSchema?
Choose File → Export As... → HTML5/PDF Documentation, and DbSchema writes the diagram and a description of every table and column as an HTML5 page, a PDF or a Markdown file (schema documentation). DbSchema Pro documents any diagram, and Community a diagram of up to 12 tables, with "DbSchema Trial" across its image.
Sources
- DbSchema: connect to a database, foreign keys, diagrams, schema documentation and the edition comparison
- pgAdmin ERD Tool
- DBeaver ER diagrams and Edit mode
- MySQL Workbench: reverse engineering a live database
- ChartDB on GitHub and pricing
- Lucidchart ERD help and database diagrams
- dbdiagram.io pricing and generate DBML from a database
- DrawSQL import and pricing
See your own database as a diagram
DbSchema connects to 100+ SQL and NoSQL databases, reverse-engineers the schema into an interactive diagram, and keeps large schemas readable one part at a time.