ERD Editor

Create Entity-Relationship diagrams visually. Add tables, define columns, draw relationships, and export to SVG, PNG, or SQL.

About This Tool

The ERD Editor is a free, browser-based Entity-Relationship diagram builder that lets you design database schemas visually. Entity-Relationship diagrams (ERDs) are one of the most fundamental tools in database design, used by developers, DBAs, and architects to plan table structures and the relationships between them before writing a single line of SQL.

This tool provides a drag-and-drop canvas where you can create entities (tables) and define their columns with data types, primary key and foreign key designations, nullability, and uniqueness constraints. Columns are color-coded for quick identification: gold for primary keys, blue for foreign keys, and the default theme color for regular columns. You can draw relationships between entities using standard crow's foot notation, supporting one-to-one, one-to-many, and many-to-many cardinalities.

Once your diagram is complete, you can export it in multiple formats. SVG export gives you a scalable vector file suitable for documentation and presentations. PNG export produces a raster image at 2x resolution for crisp display on high-DPI screens. Most importantly, the SQL export generates CREATE TABLE statements with proper column definitions, primary keys, and foreign key constraints — ready to run against your database. You can also copy the generated SQL directly to your clipboard.

If you already have SQL statements and want to convert them to an ORM schema, try the SQL to Prisma Schema converter. For working with existing JSON structures, the JSON Schema Generator can help you define validation rules. And if you need to visualize differences between two schema versions, the Diff Viewer can highlight changes side by side.

All processing happens entirely in your browser. Your diagram data never leaves your machine — there are no server round-trips, no cloud storage, and no third-party services involved. This makes the tool safe to use for designing schemas that contain sensitive table names or proprietary data structures.

How to Use

  1. Click Add Entity to create a new table on the canvas, or click Sample to load an example ERD with users, posts, and comments.
  2. Click on an entity in the canvas to select it. The right-side properties panel shows the table name and columns.
  3. Edit the Table Name in the properties panel. Add new columns by clicking the Add button, and configure each column's name, type, PK, FK, nullable, and unique settings.
  4. To draw a relationship, click Add Relationship in the toolbar. Select the from-entity, from-column, relationship type (one-to-one, one-to-many, or many-to-many), to-entity, and to-column, then confirm.
  5. Drag entities on the canvas to arrange them. The relationship lines and crow's foot markers update automatically.
  6. Review the SQL Preview at the bottom to see the generated CREATE TABLE statements in real time.
  7. Export your diagram using the SVG, PNG, or SQL buttons. Press Ctrl+Shift+C to copy the SQL to your clipboard.

Popular ERD Editor Examples

View all ERD Editor examples →

FAQ

What is an Entity-Relationship Diagram (ERD)?

An Entity-Relationship Diagram (ERD) is a visual representation of the tables (entities) in a database and the relationships between them. Each entity has attributes (columns) with data types and constraints. ERDs are essential for planning database schemas before implementation and for documenting existing databases.

What is crow's foot notation?

Crow's foot notation is a popular way to represent relationship cardinality in ERDs. A single line indicates 'one' and a three-pronged fork (resembling a crow's foot) indicates 'many'. For example, a one-to-many relationship shows a single line on the 'one' side and a crow's foot on the 'many' side. This tool uses crow's foot notation for all relationship lines.

Can I export my ERD as SQL?

Yes. The tool generates standard SQL CREATE TABLE statements with column definitions, data types, NOT NULL constraints, UNIQUE constraints, PRIMARY KEY declarations, and FOREIGN KEY references. You can download the SQL as a .sql file or copy it to your clipboard with the Copy SQL button (or Ctrl+Shift+C).

What export formats are supported?

Three export formats are available: SVG (scalable vector graphics, ideal for documentation and presentations), PNG (raster image at 2x resolution for high-DPI displays), and SQL (CREATE TABLE statements ready to execute against your database).

How do I create a many-to-many relationship?

In database design, many-to-many relationships are typically implemented using a join table (also called a junction or bridge table). In this tool, create a third entity for the join table with foreign keys pointing to both related entities, then add two one-to-many relationships. Alternatively, you can directly select 'Many-to-Many' as the relationship type between two entities.

Is my data safe?

Yes. All diagram creation, editing, and export operations run entirely in your browser using JavaScript and SVG. No data is sent to any server. Your table names, column definitions, and diagram layout never leave your machine. You can verify this by checking the Network tab in your browser's developer tools.

Can I import an existing database schema?

The current version focuses on visual diagram creation. To work with existing SQL schemas, you can use the SQL to Prisma converter to transform your CREATE TABLE statements into Prisma models, or manually recreate the schema in the ERD editor. Reverse engineering from SQL is planned for a future update.

Related Tools