SQL to ERD Diagram Generator
Upload a MySQL .sql file and instantly get an interactive entity-relationship diagram. The parser reads CREATE TABLE and ALTER TABLE statements to extract tables, columns, primary keys, foreign keys, unique keys and indexes — then draws them on a zoomable, draggable canvas. Everything runs in your browser, so your schema never leaves your device. Full guide →
Read a schema fast with an ERD built from SQL
What is this tool?
Paste your `CREATE TABLE` statements (MySQL, PostgreSQL, SQLite…) and the tool draws an entity-relationship diagram: each table is a node, each foreign key is an edge. Drag, arrange, and see how tables relate — no database install or desktop tool required.
Everything runs in your browser; the SQL you paste never leaves the page. Handy for internal or sensitive schemas you still want to visualise and share in docs or reviews.
Related Tools
All toolsAbout SQL to ERD: Visualize Your Database Schema
Paste or upload SQL DDL and turn it into a clean entity-relationship diagram. Supports MySQL CREATE TABLE / ALTER TABLE with primary keys, composite keys, foreign keys, unique keys, indexes, defaults, AUTO_INCREMENT and comments. Auto-layout with Dagre, then export to JSON, PNG or SVG.
Key Features
- -Parse MySQL CREATE TABLE and ALTER TABLE DDL
- -Detect primary keys, foreign keys, unique keys and indexes
- -Interactive canvas — zoom, pan, drag tables, minimap
- -Automatic graph layout (Dagre) with one-click re-layout
- -Searchable sidebar to jump to any table
- -Export the parsed model as JSON, or the diagram as PNG/SVG
- -100% client-side — your schema never leaves the browser
Use Cases
Understand a Legacy Database
Drop in a production schema dump and see every table and relationship at a glance before making changes.
Documentation & Onboarding
Export a PNG or SVG of the ER diagram for READMEs, wikis, and onboarding docs so new engineers ramp up faster.
Schema Reviews
Visualize migrations and pull-request schema changes to catch missing foreign keys or denormalized tables.
Data Modeling
Sketch and validate relationships while designing a new schema, then export the structured JSON model.
Frequently Asked Questions
Which SQL dialects are supported?▾
Is my SQL uploaded anywhere?▾
What does the tool extract?▾
Can I export the diagram?▾
What happens with SQL it cannot parse?▾
Tips & Best Practices
- -Use Auto Layout after loading to arrange tables left-to-right by relationship
- -Click a table in the sidebar to center the canvas on it
- -Export to SVG for crisp, scalable diagrams in documentation
- -Load the bundled sample to see how the output looks before uploading your own schema