SQL to ERD — Visualize SQL Online

Paste CREATE TABLE statements and get an editable ER diagram — drag tables, trace foreign keys, group by domain.

No signup required.

Your SQL
CREATE TABLE users (
    id         BIGINT PRIMARY KEY,
    name       VARCHAR(255) NOT NULL,
    email      VARCHAR(255) UNIQUE,
    created_at TIMESTAMP
);

CREATE TABLE posts (
    id         BIGINT PRIMARY KEY,
    user_id    BIGINT REFERENCES users(id),
    title      VARCHAR(255) NOT NULL,
    published  BOOLEAN DEFAULT false
);

CREATE TABLE comments (
    id         BIGINT PRIMARY KEY,
    post_id    BIGINT REFERENCES posts(id),
    user_id    BIGINT REFERENCES users(id),
    body       TEXT NOT NULL
);
Your diagram
Blog
users
id bigint
namevarchar
emailvarchar
created_atts
comments
id bigint
post_idbigint
user_idbigint
bodytext
posts
id bigint
user_idbigint
titlevarchar
publishedbool

Used by 600,000+ developers — including teams at

Storytel
Instacart
Cisco
Accenture
Fujitsu
Lush

Try it now

Paste SQL, get a diagram

Works with AI

Ask your AI for a DrawSQL link

Get an interactive schema back, not just a wall of SQL text. Works with ChatGPT, Claude, Gemini, Codex — any AI that can generate SQL.

"Design a PostgreSQL schema for a SaaS with organizations, users, and projects. Generate CREATE TABLE SQL, URL-encode it, and include a link in this format: https://drawsql.app/draw?driver=pgsql#ddl=<url-encoded-sql>"

organizations id uuid name text plan text users id uuid org_id FK email text role text projects id uuid org_id FK owner_id FK name text

FAQ

Frequently asked questions

DrawSQL supports CREATE TABLE statements from MySQL, PostgreSQL, and SQL Server. The dialect is auto-detected from your SQL syntax — for example, SERIAL and JSONB are recognized as PostgreSQL, while NVARCHAR and IDENTITY indicate SQL Server.
Yes. Without an account, you can share a snapshot link — a frozen copy of your diagram at that moment. Create a free account to get a live link that always shows the latest version, plus export to image or SQL.
It’s saved in your browser’s localStorage. Reopen the page and it’s still there. For permanent storage, create a free account.
Yes. Up to 20 tables, no signup, no card. Your work saves in your browser automatically. Create a free account to save diagrams permanently and share them with your team. Paid plans add real-time collaboration, DrawSQL AI, and unlimited diagrams.
Ask ChatGPT, Claude, or any AI: “Design a schema. Generate CREATE TABLE SQL, URL-encode it, and include a link in this format: https://drawsql.app/draw#ddl=<url-encoded-sql>” — then click the link you get back.

Next step

Visualize your SQL now. Save it if it sticks.

No account needed to start. If the diagram becomes useful, save it and bring the team in.

Don't have SQL yet? Ask your AI to generate it.