SQL Schema Visualizer
Paste SQL DDL and instantly visualize tables, columns, primary and foreign keys as an interactive ER diagram, with exportable Mermaid output.
Loading tool...
What is SQL Schema Visualizer?
The SQL Schema Visualizer is a database tool that parses SQL DDL you paste in and renders an entity-relationship style view of your schema, entirely in the browser. Every table becomes a card listing columns, data types, and key flags, while foreign key references become traceable relationships you can export as a Mermaid ER diagram.
Key Benefits
- Understand an unfamiliar database in seconds instead of reading raw DDL line by line.
- Spot missing keys, inconsistent types, and orphaned references visually.
- Document your schema with a Mermaid ER diagram that lives next to your code.
- Keep proprietary schemas private since everything runs client-side.
Common Use Cases
- β’Onboarding onto a legacy database with dozens of CREATE TABLE migration files.
- β’Reviewing a pull request that adds new tables or foreign keys.
- β’Generating ER diagrams for technical design documents and wiki pages.
- β’Teaching or learning database normalization with a concrete example schema.
How to Use the SQL Schema Visualizer
- Paste your SQL: Copy CREATE TABLE statements from your migration files or database dump and paste them into the SQL input panel, or click Example to load a sample schema.
- Parse the schema: The tool instantly parses tables, columns, keys, and constraints as you type. Watch the table count and relationship count update live.
- Explore the diagram: Browse the generated table cards showing every column with its data type, key icons for primary and foreign keys, and NULL/UNIQUE flags.
- Export Mermaid: Click Copy Mermaid ER to put a ready-to-render erDiagram definition on your clipboard, then paste it into any Mermaid-compatible documentation.
Key Features
- Parses CREATE TABLE statements including inline and table-level constraints.
- Detects primary keys, foreign keys, UNIQUE, NOT NULL, DEFAULT, and AUTO_INCREMENT.
- Follows ALTER TABLE ADD FOREIGN KEY statements for out-of-line relationships.
- Generates a Mermaid ER diagram you can paste into docs, wikis, or GitHub issues.
- Handles quoted identifiers (backticks, double quotes, brackets) and SQL comments.