Database schema visualizer

Paste SQL DDL or upload a .sql file to generate an ER diagram. Best support is for common CREATE TABLE,PRIMARY KEY, and FOREIGN KEY patterns.

Need more than a template?

Need something built around this?

I build internal tools, integrations and full-stack products for startups and growing teams.

Full-stack engineering →

How to use the database schema visualizer

Paste SQL or upload a .sql file and the tool draws the tables and the relationships between them as an entity-relationship diagram. It reads CREATE TABLE statements, primary keys and foreign keys, including foreign keys added later with ALTER TABLE. The SQL itself stays in your browser. Only the diagram library, Mermaid, is fetched from a public CDN the first time the page draws a diagram.

  1. Paste your schema, or upload a .sql file. A small sample is loaded to show the format.
  2. Look at the diagram. Each table lists its columns, and lines join foreign keys to the tables they point at.
  3. Copy the generated Mermaid text if you want to put the diagram into documentation or a pull request.

Worked examples

Three tables, two relationships

CREATE TABLE users (id UUID PRIMARY KEY, email VARCHAR(255) NOT NULL);
CREATE TABLE projects (id UUID PRIMARY KEY, owner_id UUID REFERENCES users(id));
CREATE TABLE tasks (id UUID PRIMARY KEY, project_id UUID REFERENCES projects(id));

One user owns many projects, and one project has many tasks. The diagram draws both lines.

Mistakes to avoid

  • Expecting every dialect to parse

    Common CREATE TABLE syntax works. Vendor-specific extensions, partitioning clauses and tables created by procedures may be missed, and the tool reports when it finds nothing.

  • Leaving foreign keys out

    A diagram is only as useful as the relationships in the SQL. Schemas that rely on application code to link tables, with no REFERENCES, show tables with no lines.

  • Same table name in two schemas

    The tool drops schema prefixes, so public.users and audit.users are read as one table called users. If your database reuses names across schemas, paste one schema at a time.

  • Pasting a whole database dump

    Data statements are ignored, but a large dump can still be slow to read. Export the schema only.

Questions people ask

Can I use the diagram in documentation?
Yes. Copy the Mermaid text into a Markdown file. GitHub, GitLab and many documentation tools render Mermaid blocks, so the diagram stays in version control next to the schema.
Which databases does it work with?
It reads common SQL used by PostgreSQL, MySQL and SQL Server style schemas. Quoted names using double quotes, backticks and brackets are cleaned up.
Is my schema uploaded?
No. The parsing runs in your browser. The diagram library loads from a CDN, which means your browser makes a request for that script.

Related