ERD Generator

Generate ER diagram code from SQL DDL — export as Mermaid.js, PlantUML, or Graphviz DOT

  1. Home
  2. /
  3. ERD Generator

Generated ERD Code

erDiagram
  USERS ||--o{ ORDERS : "has"
  USERS {
    int id PK
    string name
  }

Tables

0

Relationships

0

Format

-

Lines

0

What Is an ER Diagram?

An Entity-Relationship Diagram (ERD) is a visual representation of database tables and their relationships. It shows entities as boxes, attributes as fields, and relationships as lines connecting foreign keys. Generated code can be used with Mermaid.js (renders in GitHub Markdown), PlantUML, or Graphviz.

How to Use This Tool

  1. Paste your SQL DDL — Enter one or more CREATE TABLE statements with primary and foreign keys.
  2. Select output format — Choose Mermaid.js ERD, PlantUML, or Graphviz DOT format.
  3. Click Generate — The tool parses your DDL and generates ERD code in the selected format.
  4. Copy or download — Click Copy to grab the code, or Download to save the file for use in documentation.
  5. Embed in your project — Paste Mermaid ERD into GitHub Markdown, PlantUML into documentation, or DOT into Graphviz tools for rendering.

Frequently Asked Questions

What is the difference between this and the DB Schema Visualizer?

The DB Schema Visualizer renders an interactive graphical diagram in your browser. This ERD Generator produces code in Mermaid, PlantUML, or DOT format that you can embed in Markdown, wikis, or documentation tools.

Which SQL dialects are supported?

The parser supports MySQL, MariaDB, PostgreSQL, and SQLite CREATE TABLE statements, including PRIMARY KEY, FOREIGN KEY, AUTO_INCREMENT, and various column types and constraints.

Can I use Mermaid output in GitHub Markdown?

Yes. GitHub natively renders Mermaid.js ERD diagrams in Markdown files. Simply paste the generated Mermaid code into a code block with the mermaid language tag.

Is my schema data sent to a server?

No. All parsing and code generation happens locally in your browser. Your SQL schema never leaves your device.

How do I render PlantUML or DOT output?

PlantUML requires a PlantUML server or the PlantUML plugin for your IDE. Graphviz DOT can be rendered using the dot command-line tool or online Graphviz viewers.

Last updated: 9 Jul 2026