How to dBML to ERD
- Paste your DBML into the box that opens, or open a .dbml file. Use Load example to see the syntax.
- Check the summary of tables and relationships found. Syntax errors are shown with their line number; refs that point at missing tables or columns are listed as notes.
- Choose Create diagram, arrange and edit it, then export DBML, SQL for PostgreSQL, MySQL, SQL Server or SQLite, or a PNG, SVG or PDF image.
What does this tool do?
DBML (Database Markup Language) is a readable way to write a schema, popularised by dbdiagram.io and often kept in a repository next to the code. The importer reads Table blocks with aliases and header colours, column settings ([pk], [increment], [not null], [unique], [default: …], [note: …], inline [ref: > table.column]), indexes blocks with composite and named indexes, table notes, and standalone Ref statements in all four forms: many-to-one (>), one-to-many (<), one-to-one (-) and many-to-many (<>), including delete and update actions. Project, Enum and TableGroup blocks are accepted and skipped.
Once imported, the schema is an ordinary editable diagram: rename columns, add tables, change cardinality, run Validate Schema and export DBML again. The output uses standard DBML so it round-trips with other tools. Parsing happens in your browser, so the schema isn't uploaded anywhere.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Frequently asked questions
How are DBML relationship symbols drawn?
“>” is many-to-one (the left column references the right), “<” is one-to-many, “-” is one-to-one and “<>” is many-to-many. Each becomes a crow's-foot line with matching ends, and delete/update settings carry over to the relationship.
Are enums supported?
Enum blocks are accepted, and columns that use an enum keep its name as their type. The enum values themselves aren't drawn.
Can I go from DBML to SQL?
Yes. After importing, choose SQL → Generate SQL and pick PostgreSQL, MySQL, SQL Server or SQLite.
Is this affiliated with dbdiagram.io?
No. It's an independent, free tool that reads and writes the open DBML format.
Last reviewed by the M2Toolkit team.