Reference · UML
UML symbols: what each shape means in the main UML diagrams
In short
UML symbols are the standard shapes of the Unified Modeling Language. A class is a box with three compartments, an actor is a stick figure and a use case an ellipse, a sequence diagram has lifelines (dashed vertical lines) with message arrows between them, and activity and state diagrams start at a filled circle, end at a bull's eye, branch at a diamond and split into parallel flows at a bar. The lines between class boxes are the UML arrows, which have their own page.
Updated · by the ChartCraft team · drawings rendered with Mermaid 11.17.2 · part of the UML diagram types reference
Which UML symbols do you need to know?
UML 2.5.1 defines fourteen diagram types, but courses and exams mostly use five: class, use case, sequence, activity and state machine. Each has a small set of symbols, and a few, like the rounded rectangle and the diamond, appear in more than one.
| Diagram | Core symbols | What it shows |
|---|---|---|
| Class | Class box, interface, the six relationship lines, multiplicity | The structure: classes, their data and how they relate |
| Use case | Actor, use case ellipse, system boundary, include and extend | Who uses the system and for what |
| Sequence | Lifeline, activation bar, synchronous, asynchronous and reply messages, fragments | Who calls whom, in time order |
| Activity | Initial node, action, decision, fork and join bar, final nodes | A workflow or algorithm, including parallel work |
| State machine | State, transition, initial and final state, choice | The life of one object from state to state |
The other nine diagram types are listed on the 14 UML diagram types.
What are the class diagram symbols in UML?
A class is a rectangle with three compartments: the name at the top, attributes in the middle, operations at the bottom. A sign before each member gives its visibility. Keywords in guillemets mark special kinds of class.
| Symbol | Name | Meaning |
|---|---|---|
| Class | Name, attributes and operations. + public, - private, # protected, ~ package | |
| Interface | A set of operations that classes promise to provide, marked «interface» | |
| Abstract class | A class that cannot be created on its own. UML shows the name in italics; Mermaid writes «abstract» and marks abstract operations with * | |
| Enumeration | A fixed list of values, marked «enumeration» |
classDiagram
class Student {
-int studentId
+String name
+enrol(Course c) bool
}More on the class box, including static members and multiplicity: class diagram symbols.
What are the use case diagram symbols?
UML 2.5.1 shows a use case as an ellipse with its name inside, and an actor as a stick-man. A rectangle around the use cases is the system boundary, and plain lines join actors to the use cases they take part in.
| Symbol | Name | Meaning |
|---|---|---|
| Actor | A role outside the system: a person, another system or a device | |
| Use case | Something the system does that gives the actor a result, named with a verb | |
| System boundary | Everything inside is part of the system | |
| Include | The base use case always uses the included one. Dashed arrow toward the included use case | |
| Extend | Optional behaviour added to a base use case under a condition. Dashed arrow toward the base |
Examples and the full guide: use case diagram.
What are the sequence diagram symbols?
Each participant has a lifeline, a dashed vertical line under its name, and time runs down the page. UML 2.5.1 gives a synchronous call a filled arrowhead, an asynchronous message an open arrowhead, and a reply a dashed line.
| Symbol | Name | Mermaid |
|---|---|---|
| Lifeline | participant App | |
| Activation bar | activate App | |
| Synchronous message: the sender waits | A->>B: call() | |
| Asynchronous message: the sender carries on | A-)B: notify() | |
| Reply message | B-->>A: result |
sequenceDiagram
actor Student
participant App
participant Library
Student->>App: search(title)
App->>Library: findBook(title)
Library-->>App: book
App-->>Student: show(book)sequenceDiagram
participant App
participant Library
App->>Library: reserve(book)
alt book available
Library-->>App: confirmed
else on loan
Library-->>App: added to waiting list
end
What are the activity diagram symbols?
UML 2.5.1 notates the initial node as a solid circle and the activity final node as a solid circle within a hollow circle, a bull's eye. Fork and join nodes are line segments (bars), and decision and merge nodes are diamonds.
| Symbol | Name | Meaning |
|---|---|---|
| Initial node | Where the activity starts | |
| Action | One step of work, a rounded rectangle | |
| Decision or merge | A diamond: one flow in and guarded flows out, or several in and one out | |
| Fork or join | A bar: one flow splits into parallel flows, or parallel flows wait for each other | |
| Activity final | The whole activity ends | |
| Flow final | Only this flow ends; a circle with an X |
stateDiagram-v2
state fork_state <<fork>>
state join_state <<join>>
[*] --> fork_state
fork_state --> PackOrder
fork_state --> ChargeCard
PackOrder --> join_state
ChargeCard --> join_state
join_state --> [*]Swimlanes, signals and more: activity diagram symbols.
What are the state machine diagram symbols?
A state is a rounded rectangle and a transition is an arrow labelled with the event that causes it. The black dot is the initial pseudostate and the bull's eye the final state; a diamond is a choice between transitions.
stateDiagram-v2
direction LR
[*] --> Available
Available --> OnLoan : borrow
OnLoan --> Available : return
OnLoan --> Overdue : due date passes
Overdue --> Available : return and pay fine
Available --> [*] : withdrawn| Drawing | Say it like this |
|---|---|
| A book starts Available. Borrowing it makes it OnLoan. If the due date passes it becomes Overdue. Returning it makes it Available again. | |
| When a book is returned, a choice sends it to Available if it is undamaged and to Repair if it is damaged. |
How do you draw a UML class diagram step by step?
Take a library again: members borrow books and every loan has a due date. Three steps take you from nouns to a finished class diagram.
Step 1
Find the classes
Underline the nouns in the scenario that have their own data: Member, Loan, Book. Each becomes a class box.
classDiagram
direction LR
class Member
class Loan
class BookStep 2
Fill the compartments
Put the data each class holds in the middle compartment and what it can do in the bottom one.
classDiagram
direction LR
class Member {
+String name
+borrow(Book b) Loan
}
class Loan {
+Date due
+isOverdue() bool
}
class Book {
+String isbn
+String title
}Step 3
Add relationships and multiplicities
A member has zero or many loans, written 1 and 0..* at the two ends. Each loan is for exactly one book.
classDiagram
direction LR
class Member {
+String name
+borrow(Book b) Loan
}
class Loan {
+Date due
+isOverdue() bool
}
class Book {
+String isbn
+String title
}
Member "1" --> "0..*" Loan : has
Loan "0..*" --> "1" Book : forDraw this in the editor → Opens ChartCraft with this description filled in: “UML class diagram for a library: a Member with name and borrow(book), a Loan with due date and isOverdue(), a Book with isbn and title. A member has zero or many loans, each loan is for one book.”
Which UML symbol mistakes lose marks?
Most lost marks come from using the right shape in the wrong diagram.
1. A use case drawn as a rectangle
Loses marks
A box labelled with the use case
Correct
An ellipse
UML 2.5.1 shows a use case as an ellipse. The rectangle is the system boundary around the ellipses.
2. A reply drawn with a solid line
Loses marks
Solid line, filled head
Correct
Dashed line
A reply message has a dashed line. A solid line with a filled head is a new synchronous call.
3. The start of an activity drawn as a bull's eye
Loses marks
Bull's eye at the top
Correct
Solid circle at the top
The solid circle starts the activity and the bull's eye ends it.
Is there a printable UML symbols cheat sheet?
Yes. Twenty symbols from the five diagrams on one page.
Can you answer these five UML symbol questions?
Answer, then open the worked answer.
Question 1. What does a minus sign before an attribute mean?
Worked answer
Private: only the class itself can use it. + is public, # protected and ~ package.
Question 2. In a sequence diagram, how do you tell a synchronous call from an asynchronous message?
Worked answer
By the arrowhead: filled for synchronous, open for asynchronous.
Question 3. Which symbol splits an activity into two parallel flows?
Worked answer
A fork, drawn as a thick bar with one flow in and several out. A join bar brings them back together.
Question 4. What is the difference between an activity final and a flow final node?
Worked answer
An activity final (bull's eye) ends the whole activity. A flow final (circle with an X) ends only the flow that reaches it.
Question 5. Which diagram uses a stick figure, and what does it stand for?
Worked answer
The use case diagram. The stick figure is an actor: a role outside the system, which may be a person or another system.
Questions
What are UML symbols?
The standard shapes of the Unified Modeling Language: class boxes, actors, use case ellipses, lifelines, messages, action nodes, states, and the lines and arrowheads that join them.
What are the UML class diagram symbols?
A class box with name, attributes and operations, interface and enumeration boxes, visibility signs (+, -, #, ~), multiplicities, and the relationship lines: association, generalization, realization, dependency, aggregation and composition.
What are the UML use case diagram symbols?
The actor (a stick figure), the use case (an ellipse), the system boundary (a rectangle), association lines, and dashed include and extend arrows.
What are the UML activity diagram symbols?
Initial node (solid circle), action (rounded rectangle), decision and merge (diamond), fork and join (bar), activity final (bull's eye) and flow final (circle with an X).
What does the black dot mean in UML?
The start: the initial node of an activity diagram or the initial pseudostate of a state machine.
What is the difference between UML and an ER diagram?
An ER diagram models stored data. A UML class diagram models software classes, which also have operations, and uses different relationship symbols.
Sources
The rules and names on this page were checked against these documents.
- OMG Unified Modeling Language, version 2.5.1. The notation of each element: Generalization (hollow triangle), Realization (dashed line, triangular arrowhead), Dependency (dashed arrow), shared and composite aggregation (hollow and filled diamond), Message sorts (filled, open and dashed arrowheads), activity nodes, UseCase (ellipse) and Actor (stick-man).
- Mermaid documentation, Class diagrams. Relationship syntax: <|--, *--, o--, -->, --, ..>, ..|> and ..; annotations such as <<interface>>; multiplicities in quotes.
- Mermaid documentation, Sequence diagrams. Message arrows ->>, -->> and -), actors, and alt, loop and opt fragments.
- Mermaid documentation, State diagrams. [*] start and end, <<choice>>, <<fork>> and <<join>>.