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 shapes
The shapes for the four structure and behaviour diagrams people draw most.
| Symbol | Name | Meaning |
|---|---|---|
| Class | ClassThree compartments: name, attributes, operations. Type three dashes on a line to start the next compartment. | |
| Actor | ActorA role that uses the system from outside: a person or another system. | |
| Use case | Use caseA goal an actor achieves with the system, named as a verb phrase. | |
| State | StateA condition an object stays in until an event moves it on. | |
| Initial state | Initial stateWhere a state machine starts. | |
| Final state | Final stateWhere a state machine ends. | |
| Component | ComponentA replaceable part of a system with defined interfaces. | |
| Package | PackageA namespace that groups related classes. | |
| Note | 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.
| Line | Name | Meaning |
|---|---|---|
| Association | AssociationOne class uses or knows about another. | |
| Inheritance (generalization) | Inheritance (generalization)The class at the tail is a kind of the class at the triangle. | |
| Realization | RealizationA class implements the interface at the triangle. | |
| Composition | CompositionThe part cannot exist without the whole at the filled diamond. | |
| Aggregation | AggregationThe whole at the hollow diamond groups parts that can exist on their own. | |
| Dependency | DependencyA change to the class at the arrow may affect the class at the tail. |
How to draw one
Open the editor with the UML shapes and add a class. Double-click it to edit the name, attributes and operations as text.
Add the related classes and connect them.
Select each connector and choose its relationship: inheritance, composition, aggregation, association or dependency.
Add multiplicities such as 1..* as the connector's label, then tidy the layout and export.
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
- Data modeling
Crow's foot notation explained: reading cardinality in ER diagrams
How to read and draw crow's foot notation: the four line endings, which end to read, how each maps to foreign keys, NOT NULL and UNIQUE in SQL, and the mistakes that model the wrong rule. - UML
UML class diagram relationships: association, aggregation, composition and the rest
The six UML class diagram relationships, the line and arrowhead for each, what they mean in code, how to read multiplicity, and when aggregation is worth drawing at all.
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.