Last updated 3 September 2026
sql2erd turns SQL DDL into a clear entity relationship diagram. Paste
CREATE TABLE statements, get a diagram with primary keys, foreign keys and
orthogonal connectors — then export it as SVG or PNG.
Three stages, all client-side:
The status line under the editor reports how long each stage took, so the cost of a large schema is visible rather than guessed at.
sql2erd never connects to a database. It reads the DDL text only. That is a deliberate trade-off: it means the tool works on a schema that has not been deployed yet, on a migration file in a pull request, or on a production dump you are not allowed to connect to — and it means your credentials are never involved. The cost is that anything not expressed in the DDL (data, statistics, runtime constraints) is invisible to it.
PostgreSQL and MySQL DDL are supported, including table constraints, inline and separate
FOREIGN KEY declarations, and ALTER TABLE … ADD CONSTRAINT. Layout
can be centred on one table with concentric rings, which helps when a schema is large enough
that a plain graph becomes unreadable.
The same product exists as a local CLI that writes SVG and PNG files, useful for CI pipelines and for schemas you would rather not open in a browser at all. The two share a name and a design, but are separate implementations.
Nothing is collected — see the Privacy Policy, which explains how a
Content-Security-Policy header enforces that rather than merely promising it.
Usage is governed by the Terms of Use; note in particular that generated
diagrams should be reviewed before you rely on them.
© 2026 Ho Hai Nghia. All rights reserved. · sql2erd.dev