Code BeautifierDev Tools

SQL DDL → Mermaid ER Diagram

Parse CREATE TABLE statements and export a Mermaid erDiagram with PK/FK annotations — client-side only.

Runs 100% in your browser · Zero server logs
Your draft is saved locally in this browser. No editor content leaves this device unless you explicitly share it.

Local workspace

Named projects in IndexedDB · Local only — never synced to our servers. Worksp

Open manager

Batch workspace

Format multiple files locally in one run.

sql
Mermaid ERDtext

How to use the SQL to ERD

1

Paste code or file

Paste your raw SQL text or upload directly.

2

Configure options

Choose indentation, dialect, or formatting preferences.

3

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

OptionDescription
Append parsed JSON tablesAppend 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.