Class Diagram
Design object-oriented systems with UML class diagrams. Visualize classes, inheritance, and relationships as you type.
classDiagram
class Vehicle {
<<abstract>>
+String make
+String model
+int year
+start() void
+stop() void
}
class Car {
+int doors
+String transmission
+honk() void
}
class Truck {
+float payload
+int axles
+loadCargo() void
}
class ElectricVehicle {
<<interface>>
+int batteryCapacity
+charge() void
+getRange() int
}
class ElectricCar {
+int chargingPort
+autopilot() void
}
Vehicle <|-- Car
Vehicle <|-- Truck
ElectricVehicle <|.. ElectricCar
Car <|-- ElectricCarModel class hierarchies, interfaces, and relationships before writing code.
Generate visual documentation of your existing codebase architecture.
Communicate software design patterns and component structure to your team.
classDiagramDeclare diagram typeclass Name { }Define a class<<abstract>>Mark class as abstract<<interface>>Mark as interface+method() typePublic method-field typePrivate field#field typeProtected fieldA <|-- BB inherits from AA <|.. BB implements AA *-- BCompositionA o-- BAggregationOpen FlowViz and start with classDiagram.
Define a class: class ClassName {.
Add attributes inside: +String name or -int count.
Add methods: +methodName() returnType.
Use <<abstract>> or <<interface>> stereotypes on their own line inside the class.
Close the class with }.
Define relationships: ClassName1 <|-- ClassName2 for inheritance.
Add labels to relationships with : "description" at the end.
No signup. No install. Just open the editor and start writing.