UML Class Diagram Generator and Other UML Diagrams

Describe your classes in plain English and get a UML class diagram with attributes, methods, and relationships.

Customer-name: String-email: String+placeOrder()Order-date: Date+addItem(p, qty)+getTotal(): DecimalOrderItem-quantity: int+getSubtotal()Product-name: String-price: Decimal+getPrice()10..*places11..**1DigitalProductPhysicalProduct
Hand-drawn example, not generated output. Describe your own system above to generate yours. Example class diagram for an online shop. Association, composition (filled diamond), and inheritance (hollow triangle), as described in the guide below.

UML Diagram Generator

Describe your UML diagram
0 / 20,000 characters

Free to try ·

Preview

UML Diagram Examples

Class, sequence, use case, activity, state, and component diagrams

View:

Class Diagram

Classes with attributes and methods, linked by inheritance, aggregation, and composition.

class-diagramoopinheritance

Use Case Diagram

Actors, use case ovals, and a system boundary — the classic way to capture requirements.

use-caseecommercerequirements

Sequence Diagram

Lifelines and messages over time — how objects collaborate to handle a request.

sequence-diagramapiinteraction

What is a UML diagram?

UML (Unified Modeling Language) is the standard visual language for modeling software. A UML diagram uses an agreed set of shapes and connectors — boxes for classes, ovals for use cases, lifelines for objects — so that any engineer can read the design the same way. UML lets a team picture a system before they build it: its structure, its behavior, and how its parts interact. This generator turns a plain-English description into a clean, correctly notated UML diagram, so you can capture a design without hand-drawing every box and arrow.

The main UML diagram types

  • Class diagram: the structure of a system — its classes, their attributes and methods, and the relationships between them. The most-used UML diagram.
  • Sequence diagram: how objects interact over time, with lifelines and the messages passed between them to complete a scenario.
  • Use case diagram: the system’s functionality from the user’s point of view — actors, use cases, and a system boundary. Great for requirements.
  • Activity diagram: the flow of a process or workflow, with actions, decisions, and parallel branches — essentially a UML flowchart.
  • State machine diagram: the states an object moves through and the events that trigger each transition over its lifecycle.
  • Component diagram: the high-level building blocks of a system and the interfaces they provide and require — useful for architecture.

How to read a UML class diagram

A class is drawn as a box split into three compartments: the class name on top, its attributes (data) in the middle, and its methods (behavior) at the bottom. A visibility marker precedes each member — plus (+) for public, minus (−) for private, hash (#) for protected. Attributes are usually written name: type, and methods as name(parameters): returnType. Read a class diagram top to bottom for what an object is and does, then follow the connectors to see how it relates to the rest of the system.

Class diagram relationships: association, inheritance, aggregation, composition

  • Association: a plain line meaning two classes have a structural link (for example, a Customer places Orders). Multiplicities such as 1 or 0..* show how many.
  • Inheritance (generalization): a hollow triangle arrow pointing to the parent class. A Dog is an Animal, so it inherits the parent’s attributes and methods.
  • Aggregation: a hollow diamond for a whole–part relationship where the part can exist on its own — a Team has Players, but the players survive if the team disbands.
  • Composition: a filled diamond for a stronger whole–part relationship where the part cannot exist without the whole — a House has Rooms, and the rooms are gone if the house is.

How to make a UML class diagram

  • Pick the classes: list the main nouns in your requirements. For an online shop that gives Customer, Order, OrderItem, and Product.
  • Fill in the three compartments: class name on top, attributes in the middle (for example, Customer: name: String, email: String), methods at the bottom (for example, Order: addItem(product, qty), getTotal(): Decimal). Prefix each member with + for public, - for private, or # for protected.
  • Connect the classes: a Customer places many Orders (association, multiplicity 1 to 0..*); an Order is made of OrderItems that cannot exist without it (composition, filled diamond); each OrderItem refers to one Product (association); a DigitalProduct and a PhysicalProduct both inherit from Product (inheritance, hollow triangle). A class that only uses another temporarily, such as Order using a PaymentGateway, is a dependency, drawn as a dashed arrow.
  • Add multiplicity at each end of a line: 1 means exactly one, 0..1 optional, * or 0..* zero or more, 1..* one or more. Then review the diagram for classes that have no relationships and for relationships that are missing.
  • To generate it here, paste a description such as "class diagram for an online shop: Customer places many Orders; Order is composed of OrderItems; each OrderItem refers to one Product; DigitalProduct and PhysicalProduct inherit from Product". The tool draws the boxes, compartments, and connectors.

Class diagram vs. ER diagram

A class diagram models objects in code: classes with attributes and methods, plus inheritance and other object-oriented relationships. An entity-relationship (ER) diagram models data in a database: entities with attributes and keys, linked by relationships with cardinality, and it has no methods. The two often describe the same domain, such as Customer and Order, from different angles. Use a class diagram when designing application code, and an ER diagram when designing tables.

Generate a UML diagram from a description

Describe what you need in plain English — for example, “a class diagram for a library with Book, Member, and Loan classes, where a Member can have many Loans,” or “a sequence diagram for a user logging in through an API gateway.” Name the diagram type you want (class, sequence, use case, activity, state, or component) and list the key elements and how they relate. The generator draws the diagram with correct UML notation, clear labels, and clean connectors, ready to export and drop into a design doc, slide, or pull request.

Using UML in software design

UML is a thinking and communication tool. Sketch a class diagram to agree on the data model before writing code; use a sequence diagram to nail down an API interaction or trace a bug across services; draw a use case diagram to align with stakeholders on scope; reach for an activity or state diagram when the logic is a process or a lifecycle. A diagram does not have to be exhaustive to be useful — even a rough UML view often surfaces missing relationships and edge cases early, when they are cheapest to fix. Generate one in seconds, then refine the description until the design reads right.

Frequently Asked Questions

Need a different view of the same system? Try the sequence diagram generator for message flows, the state machine diagram generator for object lifecycles, or the ER diagram generator for database design.