SQL to ER Diagram
Home › DBML to Mermaid

DBML to Mermaid

Paste DBML and export it as a Mermaid erDiagram you can drop into Markdown, GitHub or your docs — while you preview the live, interactive diagram.

Open the diagram tool →
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link

How it works

  1. Paste your DBML (from dbdiagram.io or a .dbml file) — DBML is auto-detected.
  2. The diagram renders instantly so you can confirm tables and relations.
  3. Click Export → Mermaid and copy the erDiagram code.
  4. Drop it into any Mermaid-aware Markdown (GitHub, GitLab, Notion, Obsidian…).

Example

This DBML:

Table users {
  id integer [pk]
  email varchar [unique]
}
Table posts {
  id integer [pk]
  user_id integer [ref: > users.id]
}

…exports as this Mermaid:

erDiagram
    users {
        integer id PK
        varchar email
    }
    posts {
        integer id PK
        integer user_id FK
    }
    users ||--o{ posts : "user_id"

Copy it from Export → Mermaid. Try it with your own →

Why use it

DBML → MermaidDBML → PlantUMLDBML → SVG

FAQ

How do I convert DBML to Mermaid?

Paste your DBML, then click Export → Mermaid and copy the erDiagram code. Tables become entities and Ref: relations become Mermaid relationships.

Where can I use the Mermaid output?

Anywhere Mermaid renders: GitHub & GitLab Markdown, Notion, Obsidian, docs sites, and the Mermaid Live Editor.

Is my schema uploaded anywhere?

No. Everything runs locally in your browser — your schema is never uploaded to or stored on any server.

Is it free?

Yes. It is completely free and open source, with no account or sign-up required.

Related