dbdiagram.io
A web tool that draws entity-relationship diagrams from a schema you type in DBML, an open text language, and converts between DBML and SQL for PostgreSQL, MySQL, SQL Server and Oracle.
- What it is
- Database clients and design tools
- Type
- Commercial product
- Made by
- Holistics
- License
- Proprietary service (the DBML language, parser and CLI are Apache 2.0)
- Facts checked
- 23 October 2026
What it is
dbdiagram.io draws database diagrams from code. You type tables, columns, enums and references in DBML (Database Markup Language) in an editor on the left, and the diagram on the right updates as you type; you can also draw a reference by dragging between two fields. DBML is small and database-agnostic: Table blocks with columns and settings such as [primary key] or [note: ...], Enum blocks, reusable TablePartial blocks, sample records, and Ref: lines such as posts.user_id > users.id for a many-to-one relationship. Diagrams export as images and PDFs, and as CREATE TABLE statements.
DBML is open source, and its CLI and the @dbml/core npm package do the conversions outside the website: sql2dbml reads PostgreSQL, MySQL, SQL Server, Snowflake or Oracle DDL, dbml2sql writes PostgreSQL, MySQL, SQL Server or Oracle, and db2dbml reads the schema straight from a live PostgreSQL, MySQL, SQL Server, Snowflake, BigQuery or Oracle database. That makes the diagram something you can regenerate in CI and keep in Git. The same maker’s dbdocs.io turns DBML into a documentation site.
The website is free for up to 10 diagrams. Personal Pro ($8 a month) adds unlimited diagrams, version history and an AI assistant that turns plain-language requests into DBML changes shown in a diff, with a monthly token quota. Team costs $75 a month for three editors and $5 for each extra editor.
Why teams pick it
- Typing is faster than drawing, and a text schema can be diffed, reviewed and kept with the code
- The language and converters are open source, so you aren’t locked into the website
- Converts in both directions between DBML and the main SQL dialects, and can read a schema from a live database
- A free plan that covers most personal use
Watch out for
- DBML covers tables, columns, references, indexes, enums and sample records; its documentation doesn’t cover views, triggers or functions, so it isn’t a full copy of a database’s schema
- The diagram is a separate document: unless you regenerate it with
db2dbml, it drifts from the real database - Version history, unlimited diagrams and the AI assistant need a paid plan
- The editor is a hosted service; only the language and its tools are open source
Alternatives
What all database clients and design tools have in common →Compare side by side →How it fits with other technologies
A schema in DBML, then converted with the CLI · text
Table users {
id integer [primary key]
username varchar
created_at timestamp
}
Table posts {
id integer [primary key]
title varchar
body text [note: 'Content of the post']
user_id integer
status post_status
}
Enum post_status {
draft
published
}
Ref: posts.user_id > users.id // many-to-one
// npm install -g @dbml/cli
// dbml2sql schema.dbml --postgres -o schema.sql
// sql2dbml dump.sql --mysql -o schema.dbmlSee it in a real stack
No architecture uses dbdiagram.io yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from2018–2025
Holistics, a Singapore-based business intelligence company, started building a diagram tool in August 2018. It began as a feature that interns built so Holistics customers could see their database schemas, and the team decided to release it on its own. Anthony Thong Do announced dbdiagram.io on October 22, 2018, as a quick database designer for analysts and developers, built on one idea: relying on a mouse to create tables and fields slows people down, so you type and the diagram follows.
About a year later users had made over 100,000 diagrams. Holistics turned the tool’s syntax into DBML, an open-source language with its own parser and converters, maintained on GitHub, and used it for dbdocs.io as well. By February 2025, 2.5 million DBML documents had been created through dbdiagram.io and dbdocs.io, by 1.4 million users. Later additions include db2dbml to read schemas from live databases, a VS Code extension and an AI assistant.
Why it’s built this way
- Write the schema as text, not draw it
- Analysts and developers work faster at a keyboard, and a text schema can be shared, versioned and converted.
- Open the language separately from the app
- Publishing DBML with a parser and SQL converters let other tools read and write it, and lets users leave the website without losing their schemas.
- Keep DBML database-agnostic
- One file can describe a schema and generate DDL for several databases, at the cost of leaving out features specific to one of them.
Timeline
- 2018
Work starts in August; dbdiagram.io announced (October 22)
- 2019
DBML repository created on GitHub (March); over 100,000 diagrams
- 2025
2.5 million DBML documents and 1.4 million users (February)
Sources8 · facts checked 23 October 2026
- dbdiagram.io: home (Holistics, DBML, import and export, AI)
- dbdiagram.io: Pricing (Free, Personal Pro $8, Team $75)
- dbdiagram docs: introduction (VS Code extension, CLI)
- dbdiagram docs: AI Assistant (DBML diffs, monthly token quotas)
- DBML: home (syntax example)
- DBML docs: syntax (Project, Table, Ref, Enum, TablePartial, records)
- DBML: CLI (dbml2sql, sql2dbml, db2dbml and their dialects)
- holistics/dbml on GitHub (Apache 2.0)
