Home › SQL to Mermaid
SQL to Mermaid
Paste your SQL CREATE TABLE statements and get a Mermaid erDiagram you can copy straight into Markdown, GitHub, or your docs — plus a live, interactive diagram.
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link
How it works
- Paste your SQL schema into the editor (PostgreSQL, MySQL, SQLite or SQL Server).
- The diagram renders instantly so you can check it.
- Click Export → Mermaid and copy the
erDiagramcode. - Drop it into any Mermaid-aware Markdown (GitHub, GitLab, Notion, Obsidian…).
Example
This SQL:
CREATE TABLE users ( id SERIAL PRIMARY KEY, email TEXT UNIQUE ); CREATE TABLE posts ( id SERIAL PRIMARY KEY, user_id INT REFERENCES users(id) );
…exports as this Mermaid:
erDiagram
users {
serial id PK
text email
}
posts {
serial id PK
int user_id FK
}
users ||--o{ posts : "user_id"
Copy it from Export → Mermaid. Try it with your own →
Why use it
- Private: everything runs in your browser — nothing is uploaded or stored on a server.
- Paste-ready Mermaid for GitHub / GitLab / Notion / Obsidian.
- Verify visually — see the live diagram before you copy.
- Free & open source — no account, no sign-up.
SQL → MermaidSQL → DBMLSQL → PlantUMLPNG / SVG
FAQ
How do I convert SQL to a Mermaid ER diagram?
Paste your CREATE TABLE statements, then click Export → Mermaid and copy the erDiagram code. Foreign keys become 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.