Schema Diagram Builder

Loading diagram builder...

  • PostgreSQL & pg_dump
  • Auto-layout
  • Runs in your browser
  • PNG · SVG · PDF · Mermaid

UML Diagram Maker: Turn SQL Into a Clear Database Diagram

Paste a PostgreSQL schema, drop in a .sql or pg_dump file, or build tables by hand, and this database diagram builder draws the entity relationship diagram for you. Foreign keys become connected lines in crow's foot notation, so students, backend developers and technical writers can explain a data model in minutes instead of redrawing boxes in a slide tool. Everything runs in your browser, so your schema is never uploaded, and you can export the result as PNG, SVG, PDF, Mermaid or SQL.

usersid uuidemail textcreated_atpostsid serialauthor_id uuidtitle textcommentsid serialpost_id intuser_id uuid
01How to use

How to Create an UML Diagram From SQL in 6 Steps

No account and no install. This is the exact path from an empty canvas to a diagram you can share.

  1. Load your schema

    Click Import and paste your CREATE TABLE statements, or drop a .sql file up to 2 MB. No SQL yet? Press Add table in the Tables panel, or load the sample schema to see how it behaves.

    pg_dump files work as they are

  2. Describe every field

    Pick a table, then set each field's name and Postgres type from the searchable list. Toggle PK, UQ, NULL and FK, and add a default such as now().

    Enter adds the next field

  3. Connect tables with foreign keys

    Switch on FK for a field, then choose the target table and column. The relationship line appears at once. Click its label to write your own wording, such as owns or has many.

    Lines update live

  4. Arrange the layout

    Drag tables by hand, or press LR (left to right) or TB (top to bottom) and let auto-layout place parent tables before their children. Turn on Snap to keep things aligned.

    Your manual drags are kept

  5. Style it for your audience

    Open Properties to choose a light, dark, blueprint or minimal theme, change colors and edge style, hide types or badges, and add a text or image watermark.

    Handy for assignments and reports

  6. Export or save

    Download a PNG (1x to 3x, optional transparent background), SVG, PDF, Mermaid erDiagram text, PostgreSQL CREATE TABLE SQL, or a JSON file you can import again.

    Nothing is stored, so export JSON to continue later

02Under the hood

How the Diagram Is Built From Your SQL

Every line on the canvas comes from a rule you can check yourself, so the picture stays a faithful copy of your schema rather than a guess.

inputposts.author_id REFERENCES users(id)
cardinalityPK or UNIQUE ? 1-1 : N-1
mermaidposts }o--|| users : "owns"
layoutparents → children (ELK layered)
  • Foreign key → line

    A field whose foreign key points at an existing table and column becomes a relationship. If the target is not loaded yet, the key stays pending and the line appears the moment it arrives.

  • Cardinality

    A foreign key on an ordinary column reads many-to-one (N-1). If that column is also a primary key or unique, it reads one-to-one (1-1).

  • Optional name matching

    Turn on Infer to match columns like user_id with a users table that has an id. It is off by default because a naming guess is not a guarantee.

  • Layered layout

    Auto-layout uses the ELK layered algorithm: referenced tables first, child tables after, and unconnected tables packed beside them without overlap.

Reading the notation (Mermaid code beside each symbol)

  • ||--||One to one
  • ||--o{One to many
  • }o--||Many to one
  • }o--o{Many to many
03Real examples

Three Real Examples: What Goes In, What Comes Out.

  • Student

    Blog database for a DBMS assignment

    Input

    Three tables (users, posts, comments) pasted as CREATE TABLE statements with REFERENCES.

    Output

    Three connected tables and three N-1 relationships, arranged left to right and exported as a PNG with the college name as a watermark.

  • Backend developer

    Documenting a production dump

    Input

    A pg_dump file where foreign keys arrive through ALTER TABLE ... ADD CONSTRAINT, plus a CREATE TYPE enum.

    Output

    Constraints applied after all tables load, every relation drawn, and Mermaid erDiagram text ready to paste into a README.

  • Founder

    Designing before writing code

    Input

    No SQL yet: tables built field by field in the form panel, with foreign keys chosen from dropdowns.

    Output

    A visual schema to review with the team, then generated PostgreSQL CREATE TABLE statements to start the migration.

FAQ

Questions Worth Asking

The questions most tools don't answer honestly

Open Import, drop your .sql file (up to 2 MB) or paste the statements, then press Import. The tool reads CREATE TABLE, primary, foreign and unique keys, enums and ALTER TABLE constraints, and draws the diagram automatically. No account is needed.
No. Parsing, layout and export all run inside your browser tab, and your schema is not sent anywhere. Nothing is saved either: refresh the page and the canvas resets, so export the JSON file if you want to continue later.
Yes for PostgreSQL: pg_dump output is supported, including foreign keys added with ALTER TABLE, and statements such as SET, GRANT and INSERT are skipped. MySQL CREATE TABLE statements go through a fallback parser, but PostgreSQL gives the most complete results, so double-check other dialects.
They use crow's foot notation. A three-pronged foot means many and a double bar means exactly one. A foot at posts and a bar at users reads as many posts belong to one user. Click a line's label to add your own wording.
PNG at 1x, 2x or 3x with an optional transparent background, SVG, PDF, a re-importable JSON file, Mermaid erDiagram text and PostgreSQL CREATE TABLE SQL. A text or image watermark with adjustable size and opacity can be added for reports and company documents.
UntangleTools Logo
UntangleTools Logo
UntangleTools Logo