Skip to content
flowchart.tools

UML diagram tool

Class boxes with real compartments, actors and use cases, states and transitions, and relationship lines with the endings the UML standard defines.

UML class diagram template: online store. About this example

UML shapes

The shapes for the four structure and behaviour diagrams people draw most.

SymbolNameMeaning
ClassThree compartments: name, attributes, operations. Type three dashes on a line to start the next compartment.
ActorA role that uses the system from outside: a person or another system.
Use caseA goal an actor achieves with the system, named as a verb phrase.
StateA condition an object stays in until an event moves it on.
Initial stateWhere a state machine starts.
Final stateWhere a state machine ends.
ComponentA replaceable part of a system with defined interfaces.
PackageA namespace that groups related classes.
NoteA comment attached to any element.

UML relationships

The line ending carries the meaning. Select a connector in the editor and pick one of these from the line style list.

LineNameMeaning
AssociationOne class uses or knows about another.
Inheritance (generalization)The class at the tail is a kind of the class at the triangle.
RealizationA class implements the interface at the triangle.
CompositionThe part cannot exist without the whole at the filled diamond.
AggregationThe whole at the hollow diamond groups parts that can exist on their own.
DependencyA change to the class at the arrow may affect the class at the tail.

How to draw one

  1. Open the editor with the UML shapes and add a class. Double-click it to edit the name, attributes and operations as text.

  2. Add the related classes and connect them.

  3. Select each connector and choose its relationship: inheritance, composition, aggregation, association or dependency.

  4. Add multiplicities such as 1..* as the connector's label, then tidy the layout and export.

Open the editor

Class diagrams

A class is one shape whose text you edit like a document: name on the first line, then a line of three dashes, attributes, three dashes again, operations. The box grows to fit. Start a class with «interface» or «abstract» on its own line to add a stereotype.

Use case and state diagrams

For a use case diagram, drop a system boundary, put use cases inside it and actors outside, and connect them with plain lines. For a state machine, chain states between an initial and a final state and label each transition with its event.

Sequence diagrams

Sequence diagrams are quicker to write than to draw, because the layout follows strictly from the order of messages. Use the Mermaid editor for those: write one line per message and export the rendered diagram as SVG or PNG.

UML templates

Related tools

UML guides

Questions

Which UML diagrams can I draw?
Class, use case, state machine, component and package diagrams in the visual editor. Sequence diagrams are supported through the Mermaid editor on this site, which renders them from text. Activity diagrams can be drawn with the flowchart shapes.
What is the difference between aggregation and composition?
Both mean "has a". With composition (filled diamond) the part is owned and dies with the whole, like line items on an order. With aggregation (hollow diamond) the part can exist independently, like players on a team.
Can it generate code from a class diagram, or a diagram from code?
No. This is a drawing tool. It does not generate code or reverse-engineer source files.

Other diagram types