SQL DDL → Mermaid ER Diagram
Parse CREATE TABLE statements and export a Mermaid erDiagram with PK/FK annotations — client-side only.
Local workspace
Named projects in IndexedDB · Local only — never synced to our servers. Worksp…
Batch workspace
Format multiple files locally in one run.
How to use the SQL to ERD
Paste code or file
Paste your raw SQL text or upload directly.
Configure options
Choose indentation, dialect, or formatting preferences.
Format & export
Click format, then copy, download, or inspect in tree view.
What is a SQL to ERD?
Parse CREATE TABLE statements and export a Mermaid erDiagram with PK/FK annotations — client-side only. This tool re-indents and organizes code according to standard style conventions while checking for syntax validity. Everything executes 100% inside your browser, guaranteeing zero latency and complete privacy for API keys, user tokens, and confidential database schemas.
Options Explained
| Option | Description |
|---|---|
| Append parsed JSON tables | Append a JSON dump of parsed tables after the Mermaid diagram for debugging. |
Frequently Asked Questions
What SQL dialects are supported?
Common CREATE TABLE DDL with inline REFERENCES and FOREIGN KEY constraints. Vendor-specific extensions may need simplification.
Can I render the diagram here?
This tool exports Mermaid source. Paste it into any Mermaid-compatible viewer or Markdown preview.
Is my schema uploaded?
No. Parsing stays in your browser memory.
Are primary and foreign keys detected?
Yes. Column-level PRIMARY KEY, table-level PRIMARY KEY, REFERENCES, and FOREIGN KEY clauses are annotated.
What if I only have SELECT queries?
This exporter needs DDL. Format queries with the SQL Formatter companion instead.