Skip to content
M2TOOLKIT

Editors · free tool

DBML to ERDDiagram Your DBML Schema

Turn a DBML schema into an editable diagram, then export it as SQL or an image.

Create and download as many as you want — it's free, with no watermark from us and no sign-up.

  • Editors
  • Free
  • No sign-up
  • Runs in your browser
  • Updated

Full-screen editor

Design your database in a full-screen editor

Draw tables and relationships on a large canvas with an outline on the left and properties on the right.

  • Tables, columns, primary and foreign keys
  • Crow's-foot relationships with cardinality
  • Import SQL or DBML, generate SQL for PostgreSQL, MySQL, SQL Server and SQLite
  • Export PNG, SVG or PDF

Free, no sign-up — your work saves in this browser.

  1. 1Paste your SQL, or start from scratch.
  2. 2Tables and relationships are drawn for you.
  3. 3Generate SQL for your database, or export an image.

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to convert DBML to ERD

  1. Paste your DBML into the box that opens, or open a .dbml file. Use Load example to see the syntax.
  2. 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.
  3. 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.

Other tools people use alongside the dbml to erd.