Database Schema Visualizer
This tool generates entity-relationship diagrams from your database schema directly in your browser. Paste your CREATE TABLE statements, and the tool draws a visual diagram showing tables, columns, data types, primary keys, and foreign key relationships. No data is sent to a server. Your schema definitions, table names, and database structure stay on your device. The tool is free, requires no account, and works offline after the page loads.
100% client-side. SQL stays in your browser (ons-db-schema-inputs).
3 tables, 3 relationships
Scroll to zoom. Drag empty space to pan. Drag a table to move it.
How this tool works
The database schema visualizer renders an entity-relationship diagram from SQL CREATE TABLE statements. You paste DDL (Data Definition Language) statements and the tool parses each table's column definitions, data types, primary key constraints, foreign key relationships, and NOT NULL and UNIQUE constraints. Each table is rendered as a card listing its columns with data types annotated. Foreign key constraints draw directed lines between tables using crow's foot notation to show cardinality: a single bar on one end indicates 'one' and a crow's foot on the other indicates 'many.' A layout algorithm minimizes edge crossings in the initial placement, and tables can be repositioned by dragging. Key assumption: the parser handles ANSI SQL DDL plus common extensions for PostgreSQL (SERIAL, UUID, JSONB), MySQL (AUTO_INCREMENT, ENUM), and SQL Server (IDENTITY, NVARCHAR). Views, stored procedures, triggers, and indexes are parsed but not rendered in the diagram. Edge case: self-referential foreign keys -- a column in a table that references the same table's primary key, the standard pattern for adjacency-list hierarchies such as an employee-manager relationship -- are rendered as a loop arrow from the table back to itself. The crow's foot notation on a self-referential key is always one-to-many (one parent can have many children), and a tooltip on the loop shows the full column-level constraint.
Worked example
A blog schema with users, posts, and comments produces three nodes. Arrows run from posts to users and from comments to both posts and users, so you can spot missing indexes or orphan tables before you ship migrations.
Frequently asked questions
Is my schema sent to a server?
No. The parser and renderer run entirely in your browser. Your CREATE TABLE statements, table names, column names, and relationship definitions are processed locally. No network request is made. Verify this with your browser's DevTools Network tab.
Which SQL dialects does it support?
The parser handles standard ANSI DDL syntax and dialect-specific extensions: PostgreSQL (SERIAL, UUID, JSONB, array types), MySQL (AUTO_INCREMENT, ENGINE=InnoDB, backtick quoting), SQLite (INTEGER PRIMARY KEY AUTOINCREMENT, loose typing), and SQL Server (IDENTITY, NVARCHAR, square-bracket quoting). Unknown data types are displayed as-is without breaking the diagram.
Can I export the diagram?
Yes. Export as PNG (raster image for documentation), SVG (vector image for presentations and wikis), or a JSON representation of the schema for programmatic use. The PNG and SVG exports include all tables, columns, relationships, and layout positions.
How many tables can it handle?
The tool has been tested with schemas of up to 100 tables. Beyond that, the diagram becomes visually dense and harder to navigate. For very large schemas, consider filtering your DDL to include only the tables relevant to your current task before pasting. Test with your actual input data before deploying; edge cases often behave differently than expected with real-world content.
Does it detect many-to-many relationships?
Yes, when they are implemented through a junction table. If table C has two foreign keys, one to table A and one to table B, and those foreign keys together form a composite primary key or unique constraint, the visualizer draws a many-to-many relationship between A and B through C.
Does it handle ALTER TABLE statements?
Yes. If your input includes ALTER TABLE statements that add columns, add constraints, or add foreign keys, the visualizer applies them to the corresponding table. DROP COLUMN and DROP TABLE are also handled. The order of statements matters: a table must be created before it can be altered.