← All tools
Free tool

SQL to Mermaid ER diagram converter

Paste PostgreSQL CREATE TABLE statements and get Mermaid erDiagram code instantly, entities, attributes, keys, and relationships ready for GitHub, Notion, or your docs.

schema.sql · 33 lines
diagram.mmd · 5 tables
erDiagram
    users {
        uuid id PK
        string email
        string name
        datetime created_at
    }
    posts {
        uuid id PK
        uuid user_id
        string title
        string body
        datetime created_at
    }
    tags {
        uuid id PK
        string name
    }
    comments {
        uuid id PK
        uuid post_id
        uuid user_id
        string content
    }
    post_tags {
        uuid post_id PK
        uuid tag_id PK
    }
    users ||--o{ posts : "user_id"
    posts ||--o{ comments : "post_id"
    users ||--o{ comments : "user_id"
    posts ||--o{ post_tags : "post_id"
    tags ||--o{ post_tags : "tag_id"

Frequently asked questions

How do I add an ER diagram to a GitHub README?

Paste the generated erDiagram code into a fenced mermaid block in your README. GitHub renders Mermaid natively, no images, no external service, and the diagram stays in version control next to the schema it documents.

Is it free?

Yes, completely free with no signup. Conversion runs in your browser; paste any size schema and copy the output.

Is my SQL uploaded anywhere?

No. Parsing and Mermaid generation run entirely in your browser. Your schema is never uploaded, stored, or logged.

Which PostgreSQL features are supported?

All standard DDL the dbdiagramr parser reads: tables, columns with full type strings, primary keys, inline and table-level foreign keys, and ALTER TABLE constraints. Postgres-specific types are normalized to Mermaid-safe type names.

Can I turn the result into an interactive ER diagram?

Yes. Click Visualize this schema to open the same SQL in dbdiagramr as a searchable, exportable ER diagram, better than a static Mermaid render for large schemas.

Related tools

Turn it into an ER diagram

Paste your PostgreSQL connection string and get an interactive ER diagram of your own schema in under 10 seconds. No signup required.