ER diagram generator
Early accessEarly access. Free to start.
ER diagram generator: from a plain description to a database model
Describe what your app needs to store, or paste your CREATE TABLE statements. The ER diagram generator draws entities, attributes, keys and relationships with their cardinality, ready for you to challenge.
How the ER diagram generator works
Describe the data
Write it like a requirement: 'a customer can place many orders; each order has one or more products'. Or paste the table definitions of an existing database.
Get the ER diagram
Munition lists the entities and their attributes, marks primary and foreign keys, and draws each relationship with its cardinality: one-to-one, one-to-many or many-to-many.
Challenge it, then copy it
For each line, ask 'can this exist without the other?'. Then copy the Mermaid erDiagram code, or download it as Markdown, and fix what your requirements contradict.
Early access
Model your next database before you write a migration
Join early access, describe your data in plain words and get an ER diagram with keys and cardinalities. Free to start.
What the ER diagram tool gives you
Cardinality on both ends
Each relationship shows its minimum and maximum at both ends in crow's foot notation, so 'zero or many' and 'exactly one' are visible at a glance.
Many-to-many resolved
When two entities relate many-to-many, such as students and courses, the diagram adds the join table the database will need (enrollments), with its two foreign keys.
From prose or from SQL
Paste CREATE TABLE statements to see a schema you inherited, or plain sentences for one that doesn't exist yet.
A review of your model
Ask in your description for a list of possible problems: repeated attributes, missing keys, a relationship that seems to be missing. Treat the answers as questions to check, not verdicts.
Mermaid erDiagram code
The diagram is shown on the page and copies as Mermaid erDiagram code, to keep next to your migrations and edit line by line. The Markdown download holds the same code for a design document or a course assignment.
Here, in ChatGPT or Claude, or by API
The plan: use it on this page, inside ChatGPT or Claude through the Munition connector, or from your own code through the Munition API. All three come with early access.
Who uses an ER diagram generator
A database course student with a case study
She turns the case text about a veterinary clinic (owners, pets, vets, appointments) into a first ERD, then checks each cardinality against the wording of the exercise.
A freelance developer scoping a client app
He writes up what the client said in the kickoff call about bookings, rooms, guests and payments, and brings the diagram to the next meeting to confirm the rules.
A developer inheriting an undocumented database
She pastes the schema dump and finally sees which tables depend on 'accounts' before writing a migration that touches it.
A data analyst writing joins
He diagrams the tables he queries every week to see which keys to join on, and where a one-to-many join will duplicate his totals.
A no-code builder planning her app
She lists her tables and links before building, so she doesn't end up with one giant sheet that stores everything twice.
How to make an ER diagram for free
Data modeling is a thinking job; tools only draw. Munition saves time when the requirements are scattered across notes and emails, or when a schema is too large to read table by table. Otherwise, these free methods work well.
On paper: the noun-and-verb method
The classic way to go from requirements to a model.
- Write the requirements as sentences.
- Underline the nouns: most become entities (Customer, Order, Product) or attributes (name, price).
- Circle the verbs that connect two entities: they become relationships (places, contains).
- For each relationship, ask both directions: one customer, how many orders? One order, how many customers? Write the minimum and maximum at each end.
- Give each entity a primary key, put the foreign key on the 'many' side, and turn every many-to-many into a join entity.
Mermaid erDiagram
Write erDiagram, then one line per relationship: CUSTOMER ||--o{ ORDER : places. The ends after -- are crow's foot marks: || exactly one, o| zero or one, o{ zero or many, |{ one or many (mirrored before --, as in }o). Add attributes in braces under each entity, then paste it into mermaid.live to render.
dbdiagram.io
You type tables in DBML, a short text syntax, and the diagram draws itself. It can also export the matching SQL. There is a free plan.
Generate it from an existing database
If the database already exists, let a free client draw it. pgAdmin has an ERD tool for PostgreSQL (right-click a database to open it), MySQL Workbench can reverse-engineer a schema into a diagram, and DBeaver Community shows an ER diagram tab for a schema or a table. Menu names change between versions.
Tips for a better data model
- Name entities in the singular (Customer, not Customers) and relationships with a verb.
- Check every minimum: 'at least one' or 'possibly none'? Most modeling mistakes are a wrong minimum.
- Don't store what you can compute, such as an age from a birth date or an order total from its lines, unless you have a reason.
- Write open questions on the diagram ('can a booking have two guests?') instead of guessing the rule.
Frequently asked questions
An entity-relationship diagram shows the things a system stores (entities such as Customer or Order), their attributes and how they relate. Teams draw it before or alongside the database to agree on structure and rules. The model was introduced by Peter Chen in 1976.
Each end of a relationship line carries two marks. The one touching the entity is the maximum: a bar for one, a three-pronged 'crow's foot' for many. The one further along the line is the minimum: a circle for zero, a bar for one.
Chen notation, with diamonds for relationships and ovals for attributes, is still taught in many database courses. Crow's foot is more compact and closer to the tables you will build. Use what your course or team expects; you can ask Munition for either, and the Mermaid code uses crow's foot.
Munition is free to start: joining early access costs nothing, and there will be a free plan when the tool opens, with paid plans for heavier use. Mermaid and dbdiagram.io turn text into ER diagrams for free today, and pgAdmin, MySQL Workbench and DBeaver Community draw one from an existing database.
Yes, paste your CREATE TABLE statements as text and Munition draws the tables, keys and the relationships it finds through foreign keys. Relationships that exist only in your application code, without a foreign key, will not appear unless you describe them.
The ER diagram is a model: entities, relationships and rules, sometimes drawn before any technology is chosen. The schema is the implementation in a specific database, with column types, indexes and constraints. A logical ERD maps closely to the schema; a conceptual one does not.
Not yet. The ER diagram generator is in early access: the plan is for it to work on this page, inside ChatGPT and Claude through the Munition connector, and through the Munition API for developers. In a chat, you would paste your schema or requirements and get the erDiagram code back. Join early access and tell us where you would use it: it helps us decide what to build first.
During early access, nothing you type here is processed by an AI. If you join, we may keep the start of your text with your signup, to see what people want the tool for, so leave out anything private. The tool needs your structure, never your rows: describe tables, not customer data. When the tool opens, the Munition privacy policy will describe how text is processed.
Benjamin Martin · Written with the help of AI tools. · Updated