A structural diagram that shows the classes, attributes, operations, and relationships in a system.

Class diagrams are one of the most fundamental UML diagrams used in object-oriented design. They provide a static view of a system by showing classes, their attributes (properties), methods (operations), and the relationships between classes. Class diagrams are essential for understanding the structure of a software system and are widely used in software engineering, system design, and documentation.
A blueprint for creating objects. Represented as a rectangle with three compartments: class name, attributes, and methods.
Properties or data members of a class. Can be public (+), private (-), or protected (#).
Functions or behaviors of a class. Represent what the class can do.
Connections between classes including Association, Inheritance, Aggregation, Composition, and Dependency.
Indicates how many instances of one class relate to instances of another class (e.g., 1, *, 0..1, 1..*).
Navigate to the Studio page and open the code editor. You can start with a blank canvas or use a template.
Begin your PlantUML code with @startuml and set the theme. Add a title for your diagram.
@startuml
!theme plain
skinparam backgroundColor transparent
title Class Diagram ExampleCreate classes using the 'class' keyword. Add attributes and methods inside curly braces.
class User {
-id: string
-username: string
-email: string
+login()
+logout()
+getProfile()
}Define relationships between classes using arrows and relationship types (--, <|--, *--, etc.).
class User {
-id: string
-username: string
}
class Post {
-id: string
-title: string
-content: string
}
User "1" -- "*" Post : creates
User <|-- Admin : extendsSpecify how many instances relate to each other and add descriptive labels to relationships.
User "1" -- "*" Post : creates
User "*" -- "1" Category : belongs toUse the real-time preview to see your diagram. Refine the layout, add more classes, or adjust relationships as needed.
Once satisfied, export your diagram as PNG or SVG for use in documentation, presentations, or reports.
@startuml
!theme plain
skinparam backgroundColor transparent
title E-Commerce System Class Diagram
class User {
-id: string
-username: string
-email: string
-password: string
+login()
+logout()
+register()
+updateProfile()
}
class Product {
-id: string
-name: string
-price: number
-description: string
-stock: number
+getDetails()
+updateStock()
}
class Order {
-id: string
-orderDate: date
-totalAmount: number
-status: string
+calculateTotal()
+updateStatus()
}
class OrderItem {
-quantity: number
-price: number
+calculateSubtotal()
}
class Category {
-id: string
-name: string
-description: string
}
' Relationships
User "1" -- "*" Order : places
Order "1" -- "*" OrderItem : contains
OrderItem "*" -- "1" Product : references
Product "*" -- "1" Category : belongs to
@enduml