Diagram guides · Updated October 2026
AI diagram generator: picking the diagram type that answers your question
Most disappointing diagrams are not badly drawn. They are the wrong type, drawn well. An AI diagram generator will happily render whatever you ask for, so the decision that matters happens before you type anything: what kind of relationship are you trying to show? This is a guide to which diagram to use, what each one is good at, and when the honest answer is that a diagram will not help at all.
Ask yourself first
- Is there an order to this?
- Is there more than one participant?
- Is it quantities, or relationships?
- Does its physical shape matter?
Then name the type
Mermaid renders flowchart, sequence, class, ER, state, pie, gantt, mindmap, journey and gitGraph. Unnamed requests default to a top-down flowchart.
One diagram comes back per answer, so ask for one relationship at a time.
Start from the sentence, not from the shape
Write down the question you want answered as a full sentence, then look at its main verb. The verb is the diagram type in disguise. Happens next is a process. Sends is a message. Belongs to is a relationship between records. Is currently in is a state. Makes up a share of is a proportion. Each of those has a diagram that was invented for it.
Doing this first also catches the questions that have no diagram at all. If your sentence turns out to be a list of definitions with nothing connecting them, the boxes you draw will be decorative and the arrows will be invented to justify them.
The eight types, and the question each one answers
Flowchart
What happens next, and what decides it? · graph TD / graph LR
A process with steps and branches: how a request is handled, how an algorithm proceeds, what to do when a test fails.
Sequence diagram
Who sends what to whom, in what order? · sequenceDiagram
Conversations between participants over time. A browser, a server and a database handling one login is the classic case.
ER diagram
What records exist and how do they relate? · erDiagram
Data structure before it becomes tables: students, courses, enrolments, and whether one student can have many of each.
State diagram
What mode is it in, and what moves it? · stateDiagram
Anything with a fixed set of conditions and rules for changing between them: an order, a traffic light, a subscription.
Class diagram
What types exist and what do they inherit? · classDiagram
Structure in object-oriented code, where the fields and the inheritance matter more than the runtime order.
Pie chart
What share of one whole is each part? · pie
Parts of a single total, and only when the parts genuinely add up to it.
Mindmap
What hangs off what? · mindmap
Branching a topic into subtopics for revision, where there is hierarchy but no order and no decisions.
Gantt and journey
What runs when, or how did it feel? · gantt / journey
Scheduled work along a calendar, and the step-by-step experience of a person doing something.
Flowchart or sequence diagram: the decision people get wrong
These two overlap enough to be confusing and differ enough to matter. A flowchart follows one subject through a process and is at its best when the interesting part is the branching: this test passes, so go left; it fails, so go right.
A sequence diagram follows several participants and is at its best when the interesting part is the exchange. Each participant gets a vertical lifeline and every message is an arrow between two of them, so the back-and-forth of a login or a payment stays visible instead of collapsing into one column of boxes. Describe a browser, a server and a database as a flowchart and you lose the one thing you wanted to see. The sequence diagram guide goes further into the notation.
Structure diagrams: ER, class and state
None of these three has an order. They describe how a system is arranged rather than what it does next, which is why forcing them into a flowchart produces arrows that mean nothing in particular.
An ER diagram is for records and the relationships between them, including whether one side can have many of the other, and it is the right sketch before you write any schema. A class diagram covers the same ground for object-oriented code, where inheritance and fields are the subject. A state diagram is for a thing that sits in exactly one condition at a time and changes on a trigger, which is a surprisingly common shape once you look for it. The ER diagram guide has the cardinality notation in detail.
Use case diagrams, honestly
Mermaid has no use case diagram type. Nothing in the tool will produce the textbook UML picture of stick figures and ovals inside a system boundary, and a generator that claims otherwise is rendering something else and calling it that.
What works is an approximation with graph LR: actors as nodes down the left, the actions they can take as nodes on the right, arrows between them. It carries the same information and reads clearly in a document, but it will not match the notation if your assignment is marked against UML. The use case diagram guide covers how to lay that out.
When a diagram is the wrong answer entirely
A diagram asserts that two things are connected. Where that assertion is false or vague, the picture actively misleads, and there are three cases where that happens reliably.
The first is quantity. If what you care about is how a value changes across a range, you want a plotted curve, not boxes; the graphing tools exist for that. The second is physical shape. Mermaid positions nodes and draws arrows between them, so a triangle with given angles or a benzene ring is simply not expressible, however the prompt is worded.
The third is the arrow that fails the read-aloud test. Say the arrow out loud as a sentence: weight leads to normal force is not physics, it is two labels that happen to be near each other. When the sentence does not survive being spoken, the relationship is not a process and the diagram should not be drawn.
Getting the type you asked for
Name the Mermaid keyword in the prompt. Asking for a state diagram of an order gets you one; asking how an order moves through the system gets you a flowchart, because that phrasing reads as a process and the default steer is a top-down flowchart.
If the type is right but the drawing is cluttered, edit the code rather than asking again. The mechanics of that are in the flowchart generator walkthrough, the habits that stop clutter happening are in how to draw a diagram, and if the diagram has to sit inside a narrated explanation, read visuals in a lesson.
Diagram type FAQ
How do I decide which diagram to use?
Write your question as a sentence first, then look at its verb. Happens next points to a flowchart, sends a message to a sequence diagram, belongs to to an ER diagram, is currently in to a state diagram, and makes up what share of to a pie chart. If the sentence has no relationship verb in it, you probably want prose or a list rather than a diagram.
What is the difference between a flowchart and a sequence diagram?
A flowchart follows one thing moving through steps and decisions. A sequence diagram follows several participants exchanging messages in time order, with each participant given its own vertical lifeline. If the interesting part is who talks to whom and in what order, the flowchart will flatten exactly the detail you wanted.
Which diagram types can the AI diagram generator draw?
Anything standard in Mermaid: flowchart and graph, sequenceDiagram, classDiagram, erDiagram, stateDiagram, pie, gantt, mindmap, journey and gitGraph. The default steer is a top-down flowchart, so name the type you want in your prompt.
Can it draw a use case diagram?
Not as a first-class type, because Mermaid does not have one. You can approximate the usual actor-and-oval picture with graph LR, putting actors on the left and the things they can do on the right. It communicates the same information, but it will not look like the UML notation in a textbook.
Why did I get a flowchart when I asked for something else?
The model leans towards graph TD when the request does not name a type. Say sequenceDiagram, erDiagram, stateDiagram, mindmap or pie explicitly and ask again rather than rewording the subject.
Can I get several diagrams in one answer?
No, one diagram comes back per response. That is a useful discipline: if your question needs three diagrams, it is really three questions, and splitting it usually improves all three.
When is a diagram the wrong answer?
When the content is a set of definitions with no relationships between them, when the real subject is a quantity that changes and needs a plotted curve, and when the thing has a physical shape that matters, such as a triangle with given angles or a molecular structure. Boxes and arrows cannot express geometry.
Does the diagram follow my dark mode setting?
Yes. The Mermaid theme tracks the site theme, and the rendering uses a hand-drawn style rather than hard vector lines, so a diagram you make in dark mode will not arrive as a white rectangle.
Related diagram & flowchart guides
- AI flowchart generatorDescribe a process, get a flowchart.
- How to draw a diagramPick a shape set and start somewhere.
- ER diagram generatorEntities, keys and relationships.
- Sequence diagram generatorWho calls whom, in order.
- Use case diagram onlineActors and what they can do.
Tools: Flowchart Answers · Video Answers · Ask Questions