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.

DiagramCore symbolsWhat it shows
ClassClass box, interface, the six relationship lines, multiplicityThe structure: classes, their data and how they relate
Use caseActor, use case ellipse, system boundary, include and extendWho uses the system and for what
SequenceLifeline, activation bar, synchronous, asynchronous and reply messages, fragmentsWho calls whom, in time order
ActivityInitial node, action, decision, fork and join bar, final nodesA workflow or algorithm, including parallel work
State machineState, transition, initial and final state, choiceThe 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.

SymbolNameMeaning
UML class symbol: a box with three compartments, the name Student, the attributes studentId and name, and the operation enrolClassName, attributes and operations. + public, - private, # protected, ~ package
UML interface: a class box with the keyword interface above the name PayableInterfaceA set of operations that classes promise to provide, marked «interface»
UML abstract class Shape with an abstract operation areaAbstract classA class that cannot be created on its own. UML shows the name in italics; Mermaid writes «abstract» and marks abstract operations with *
UML enumeration Grade with the literals A, B and CEnumerationA fixed list of values, marked «enumeration»
UML class symbol: a box with three compartments, the name Student, the attributes studentId and name, and the operation enrol
A class in Mermaid's classDiagram. Rendered with Mermaid 11.17.2 from the code below.
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.

SymbolNameMeaning
ActorA role outside the system: a person, another system or a device
Use caseSomething the system does that gives the actor a result, named with a verb
System boundaryEverything inside is part of the system
IncludeThe base use case always uses the included one. Dashed arrow toward the included use case
ExtendOptional behaviour added to a base use case under a condition. Dashed arrow toward the base
A use case diagram for a libraryLibrary systemStudentLibrarianSearch the catalogueBorrow a bookReturn a book
A library use case diagram, drawn by hand because Mermaid has no use case diagram.

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.

SymbolNameMermaid
Lifelineparticipant App
Activation baractivate App
Synchronous message: the sender waitsA->>B: call()
Asynchronous message: the sender carries onA-)B: notify()
Reply messageB-->>A: result
UML sequence diagram: an actor Student and lifelines App and Library exchanging synchronous calls and dashed replies
A student searches the catalogue: two calls and two replies. Rendered with Mermaid 11.17.2 from the code below.
sequenceDiagram
    actor Student
    participant App
    participant Library
    Student->>App: search(title)
    App->>Library: findBook(title)
    Library-->>App: book
    App-->>Student: show(book)
Sequence diagram with an alt combined fragment: two operands, book available and on loan
An alt fragment: a box with one operand per condition, like if and else. Rendered with Mermaid 11.17.2 from the code below.
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.

SymbolNameMeaning
Initial nodeWhere the activity starts
ActionOne step of work, a rounded rectangle
Decision or mergeA diamond: one flow in and guarded flows out, or several in and one out
Fork or joinA bar: one flow splits into parallel flows, or parallel flows wait for each other
Activity finalThe whole activity ends
Flow finalOnly this flow ends; a circle with an X
Fork and join bars: one flow splits into two parallel states, PackOrder and ChargeCard, which join again
Fork and join: packing and charging happen in parallel. Rendered with Mermaid 11.17.2 from the code below.
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.

UML state machine for a library book: initial pseudostate, states Available, OnLoan and Overdue, transitions labelled with events, and a final state
The life of a library book. Rendered with Mermaid 11.17.2 from the code below.
stateDiagram-v2
    direction LR
    [*] --> Available
    Available --> OnLoan : borrow
    OnLoan --> Available : return
    OnLoan --> Overdue : due date passes
    Overdue --> Available : return and pay fine
    Available --> [*] : withdrawn
DrawingSay it like this
UML state machine for a library book: initial pseudostate, states Available, OnLoan and Overdue, transitions labelled with events, and a final stateA book starts Available. Borrowing it makes it OnLoan. If the due date passes it becomes Overdue. Returning it makes it Available again.
State diagram with a choice pseudostate drawn as a diamondWhen 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.

Step 1: three class boxes, Member, Loan and Book, with no relationships
Three classes. Rendered with Mermaid 11.17.2 from the code below.
classDiagram
    direction LR
    class Member
    class Loan
    class Book

Step 2

Fill the compartments

Put the data each class holds in the middle compartment and what it can do in the bottom one.

Step 2: the three classes with attributes and operations
Attributes and operations. Rendered with Mermaid 11.17.2 from the code below.
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.

Step 3: Member has zero or many Loans, and each Loan is for one Book, with multiplicities at the ends
The finished class diagram. Rendered with Mermaid 11.17.2 from the code below.
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 : for

Draw 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.

UML symbols cheat sheet: use case, sequence, activity, state and class diagram symbols
One page, free to print and share.

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.

Related references

Describe the system in plain English. ChartCraft draws the UML.

UML diagram generator →