Free diagram maker

UML class diagram tool

A class diagram describes the types in a system and how they relate: what each one holds, what it can do, and which ones are kinds of which others. It is the UML diagram that survives contact with real work most often.

Free, no account, and nothing you draw is uploaded.

Published . By the DiagramDesk team.

Example uml class diagram toolPayment- amount: Money- status: Status + capture()+ refund()CardPayment- last4: string + authorise()BankTransfer- reference: string + reconcile()

The editor has a three-part class box, the hollow triangle for inheritance, and the other standard arrow ends for association, aggregation and composition.

What a class diagram is good for

  • Agreeing a design before anybody opens an editor
  • Explaining an unfamiliar codebase to somebody joining it
  • University and college coursework that is marked on notation
  • Working out whether an inheritance hierarchy is actually justified

The mistake worth avoiding: drawing every class

A class diagram that shows every class in a codebase is accurate and useless. Nobody reads a diagram with sixty boxes, and it is out of date by the end of the week. The diagrams that get used show one part of the system, a single feature or the core of the domain, at the level someone needs to change it.

A good rule is to leave out anything a reader would not miss: getters and setters, framework base classes, and the utility classes everything depends on. Keep the associations and the multiplicities, because those are what the code makes hard to see.

The arrow ends and what they mean

Hollow triangle
Inheritance. The subclass points at the thing it extends.
Dashed line, hollow triangle
Implements an interface.
Open arrow
A plain association. One class knows about the other.
Hollow diamond
Aggregation. The part can exist without the whole.
Filled diamond
Composition. Destroy the whole and the part goes with it.

Drawing the classes

  1. Open the template, which has a base class and two subclasses.
  2. Double-click a class heading to rename it.
  3. List attributes above the divider and methods below it, using - for private and + for public.
  4. Connect a subclass to its parent and set the connector's end to Hollow for inheritance.
  5. Use an open arrow for a plain association and a filled diamond for composition.
  6. Export an SVG so the text stays sharp when somebody zooms into it.

Ready to draw yours?

The example above opens in the editor, so you can edit rather than start cold.

Open the editor

UML class diagram questions

Can it generate code?

No, and it does not read code either. It is a drawing tool for the design conversation.

Does it check my UML is valid?

No. Nothing stops you drawing something UML would frown at, which is usually what you want during a design discussion.

Can I draw other UML diagrams?

Yes. There are templates for sequence diagrams and use case diagrams, and the shapes for activity and state diagrams are all in the palette.

How do I show multiplicity?

Put it in the connector label, for example 1..* at the end it applies to. Add a second small text shape if you need a label at each end.