OnSumoTools

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.

users id INT PRIMARY KEY (PK) email VARCHAR(255) NOT NULL created_at TIMESTAMP posts id INT PRIMARY KEY (PK) user_id INT NOT NULL (FK) title VARCHAR(500) body TEXT comments id INT PRIMARY KEY (PK) post_id INT NOT NULL (FK) user_id INT NOT NULL (FK) body TEXT

How does the Database Schema Visualizer work step by step?

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.

What does a typical Database Schema Visualizer result look like?

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.

Related tools

Related guides

Turn CREATE TABLE statements into a picture

Reading a schema as raw SQL gets old fast. Twenty tables, a dozen foreign keys, and you're scrolling up and down trying to remember which table points where. A diagram answers that at a glance.

Paste your CREATE TABLE statements and the tool draws an ER diagram. Each table is a box with its columns. Foreign keys become arrows between boxes, so relationships are visible without any tracing.

Working with the diagram

Drag tables around until the layout makes sense to you. Zoom in on a busy area and pan across the canvas. A sidebar lists every table, and clicking one highlights it so you can find it in a crowded diagram.

When the picture is ready, download it as an SVG. It scales cleanly, drops into documentation, and opens in any design tool.

What it reads

The parser works on standard CREATE TABLE syntax, including primary keys and foreign key constraints. Common SQL dialects are fine for the usual column definitions. Exotic vendor-specific features may not draw, and schema changes made later with ALTER TABLE won't be picked up, so paste the final table definitions instead.

If an arrow is missing, check that the foreign key is declared in the CREATE TABLE statement itself. Relationships that only exist in application code, with no constraint in the database, can't be seen by any tool reading SQL.

Spotting design problems

A visual schema makes certain issues obvious. A table with no arrows may be orphaned, or missing a constraint. A table with arrows coming from everywhere is a hub, and worth a second look. A circular chain of references can cause trouble when you insert data.

Many-to-many relationships usually show up as a join table with two foreign keys. The tool won't label it for you, but once you know the pattern it's easy to see.

  • Missing foreign keys between tables that should be related
  • Tables that never connect to anything else
  • Very wide tables that probably need splitting

Private by design

Your schema is parsed in the browser. Nothing is uploaded, which is good news if the structure reveals how your product works. Large schemas with many tables will still render, though a very big diagram takes some arranging before it reads well.

Good uses

Onboarding a new developer. Reviewing a migration before it ships. Documenting an old database nobody remembers. Explaining the data model to someone who doesn't write SQL.