Tools / Editor

SQL to Pele ER Diagram Converter

Convert SQL CREATE TABLE statements into a Pele ER diagram. Review foreign keys, optional inferred links and warnings before exporting source.

Visualize a SQL schema before your next review

Paste table definitions to make columns, keys, and relationships easier to discuss. This SQL to ER diagram converter reads CREATE TABLE statements locally in your browser. It does not connect to a database or execute the SQL.

Two tables connected by an explicit foreign key

Input

CREATE TABLE customers (
  id INT PRIMARY KEY,
  name VARCHAR(100)
);
CREATE TABLE orders (
  id INT PRIMARY KEY,
  customer_id INT,
  FOREIGN KEY (customer_id) REFERENCES customers(id)
);

Diagram source

erDiagram
  customers {
    int id PK
    varchar name
  }
  orders {
    int id PK
    int customer_id FK
  }
  customers ||--o{ orders : "customer_id"
The orders.customer_id foreign key points to customers.id. Review the generated relationship against your schema: an ER diagram is a summary, not a replacement for database constraints.

How to use this tool

  1. Select the dialect that matches your SQL: MySQL, PostgreSQL, SQLite, or MariaDB.
  2. Paste the CREATE TABLE statements. Decide whether to enable inferred relationships from column names.
  3. Convert, read the warnings, and inspect the ERD source before copying or downloading it.

What the schema conversion preserves

Schema detailResult and review point
Tables and columnsBecome entities and attributes. Names may be normalized; check warnings for identifier changes.
Primary and foreign keysKey markers and explicit references help explain links. Review composite keys and relationship cardinality in the generated output.
Inferred relationshipsNaming conventions can suggest a link, but a matching column name does not prove a database constraint. Disable inference when you need only declared relationships.
Other SQL statementsOnly CREATE TABLE is converted. Other parsed statement types are skipped with warnings; dialect-specific syntax can fail parsing.

Common questions

Can I upload a full database dump?

Use the schema definitions rather than row data. Input is limited to 200,000 characters. Split a large schema into related groups and include referenced tables in each group.

Why is a relationship missing?

Check that the foreign key is declared in a CREATE TABLE statement and that the referenced table is included. An ALTER TABLE statement is not converted. Name-based inference is optional and should be checked manually.

Can I edit an ERD without SQL?

Use the ER diagram builder to enter entities, attributes, and relationships directly. It is useful for planning a schema before you have DDL.