Skip to content
Whiteboard.zone Open the board

UML Class Diagram Template

A UML class diagram shows the classes in a system, what data and behaviour each one has, and how they relate. This template has four classes for a small shop (Customer, Order, Product and PremiumCustomer) drawn as three-part boxes with a name, attributes and methods, joined by labelled association and inheritance arrows.

Start drawing — free, no sign-up

UML Class Diagram Template

When to use a class diagram

Use it when you design object-oriented software, explain an existing codebase to a teammate, or teach classes and inheritance.

  • Designing a new system before writing code
  • Documenting classes and relationships
  • Computer science lessons and exams
  • Design reviews

What is in the template

Each class is a stack of three boxes: the class name on a blue header, the attributes with a minus sign for private, and the methods with a plus sign for public. Arrows show relationships: places and contains are associations with multiplicity (1..*), and the blue arrow with a triangle head from PremiumCustomer to Customer shows inheritance. The sample classes are an illustration. Replace them with your own.

How it works

  1. Name your classes

    Replace the headers with the main classes in your system. Start with the nouns in your requirements.

  2. Add attributes and methods

    Edit the two lower boxes of each class. Use a minus for private members and a plus for public ones.

  3. Draw the relationships

    Use association arrows for who uses whom, label them, and add multiplicity. Use the triangle arrow for inheritance.

  4. Check and share

    Walk through a use case along the arrows to see if anything is missing, then export an image for your documentation.

Frequently asked questions

Does it generate code?

No. It is a drawing board for design and teaching. It does not generate or read source code.

Is it a complete UML toolset?

No. It covers the common parts of a class diagram. For other diagram types see the sequence diagram and ER diagram templates.

Can I work on it with other people?

Yes. Start a live collaboration session from the editor and send the room link. Everyone with the link can edit the same board at the same time, and guests need no account.

How do I save or share the finished board?

Export it as a PNG or SVG image, or save it as an .excalidraw file that you can open again later and keep editing.

Your board is one click away.

Start drawing — free, no sign-up