
Design database relationship diagrams as code with DBML
dbdiagram.io is a web-based tool for designing database relationship diagrams (ERDs) using a simple, code-based markup language called DBML. Developers and data analysts write schema definitions on the left and watch a clean entity-relationship diagram render in real time on the right. Built by Holistics, it is fast, keyboard-centric, and lets teams manage diagrams as code alongside version control.
Define database schemas using Database Markup Language (DBML) and see the ER diagram update instantly.
Your entity-relationship diagram renders live as you type, keeping you in a fast keyboard-driven flow.
Generate SQL DDL statements from your DBML and export schemas for use in your database.
Upload schema.rb, models.py, or SQL files to generate diagrams from an existing database structure.
Share read-only or editable links to your diagrams with teammates and stakeholders.
Export diagrams as PNG, PDF, or other formats for documentation and presentations.
Because diagrams are defined as DBML text, they can be managed in Git and other version control systems.
Quickly sketch out tables, columns, and relationships in DBML before implementing them in your database.
Import an existing schema and generate a shareable ER diagram for onboarding and team documentation.
Track DBML files in Git so schema design changes can be reviewed alongside code.
Define the schema visually-as-code and export ready-to-run SQL DDL statements.
Centralized team workspace to collaborate, manage members, and handle licenses and billing in one place.

AI coding assistant with 300+ models and autonomous agents