PlantUML Cheat Sheet: Complete Syntax Reference for All Diagram Types

PlantUML cheat sheet — complete syntax reference for sequence, class, activity, state, ER and all diagram types

PlantUML Cheat Sheet: Complete Syntax Reference for All Diagram Types

12+ Diagram Types Covered
40+ Built-in Themes
50+ Syntax Keywords
Free No Signup Required

This plantuml cheat sheet covers every major diagram type with ready-to-copy syntax tables, a complete skinparam reference, theme list, export commands, and an error-fixing guide — all in one place. Bookmark it as your daily PlantUML reference for any project.

Whether you write diagrams in VS Code, in our free PlantUML generator online, in Confluence, or in GitLab, this plantuml cheat sheet gives you the exact syntax you need without searching through documentation.

Sections cover core syntax, sequence, class, activity, use case, state, ER, deployment, wireframe, mind map, WBS, themes, skinparam, export formats, and common errors. The final section is a quick-start plantuml cheat sheet for non-developers, PMs, and students.

Test any PlantUML syntax from this cheat sheet instantly
Paste any code block into our free online generator — no install, no Java, no account. Diagrams render in your browser in seconds.
Try Free Generator →
PlantUML Cheat Sheet — Syntax Quick Reference Sequence Diagram @startuml participant Alice Alice -> Bob : msg Bob –> Alice : ok note over Alice : text activate Bob alt condition else end @enduml Class Diagram @startuml class User { + String name int id + login() } User <|– Admin User *– Order User o– Tag @enduml Activity Diagram @startuml start : Receive request; if (valid?) then (yes) : Process; else (no) : Reject; endif stop @enduml State / ER / Deploy @startuml ‘ State diagram [*] –> Idle Idle –> Active : login Active –> [*] ‘ ER entity entity User { *id : int } User }|..|| Order @enduml PlantUML Cheat Sheet — aitoolsynergy.com — Free generator at /plantuml-generator/

PlantUML Cheat Sheet: Core Syntax and File Structure

Every plantuml cheat sheet starts with the same foundation: the @startuml / @enduml wrapper, comment syntax, and global commands that apply to every diagram type. The table below covers the core PlantUML commands you will use across all diagram types.

ElementSyntaxExample
Start marker@startuml@startuml
End marker@enduml@enduml
Diagram titletitle TEXTtitle Login Flow
Single-line comment' text' This is a comment
Multi-line comment/' ... '//' Block comment '/
Include file!include filename!include header.iuml
Apply theme!theme NAME!theme cerulean
Scale diagramscale Nscale 1.5
Header textheader TEXTheader Confidential
Footer textfooter TEXTfooter Page %page%
Captioncaption TEXTcaption Figure 1
Page breaknewpagenewpage Section 2
Hide empty membershide empty membersApplied globally
Left to right layoutleft to right directionFlips layout axis
💡 Setting up PlantUML in VS Code? Our PlantUML editor VSCode setup guide covers the full extension install, server mode configuration, and Mac-specific steps so you can test this cheat sheet syntax live with Alt+D preview.

PlantUML Cheat Sheet for Sequence Diagrams

Sequence diagrams are the most-used PlantUML type. They show time-ordered interactions between participants. Use the syntax below for participants, arrow types, notes, activation boxes, and control flow blocks including alt, loop, and group.

Participants and Lifelines

ElementSyntax
Participant (box)participant "Name" as P
Actor (stick figure)actor "Name" as A
Boundaryboundary "Name" as B
Controlcontrol "Name" as C
Entityentity "Name" as E
Databasedatabase "Name" as DB
Collectionscollections "Name" as Col
Queuequeue "Name" as Q

Arrows and Messages

Arrow TypeSyntaxMeaning
Solid arrow (sync)A -> B : messageSynchronous call
Dashed arrow (return)A --> B : messageReturn / response
Thin solidA ->> B : messageAsync / event
Thin dashedA -->> B : messageAsync return
Self messageA -> A : internalSelf-call loop
Lost messageA ->x B : lostMessage with X end

Notes, Dividers and Control Flow

ElementSyntax
Note over participantnote over A : text
Note right/leftnote right of A : text
Multi-line notenote over A, B ... end note
Activate lifelineactivate A
Deactivate lifelinedeactivate A
Divider== Phase Name ==
Delay...5 minutes later...
Alt / else blockalt condition ... else ... end
Optional blockopt condition ... end
Loop blockloop N times ... end
Parallel blockpar ... and ... end
Group blockgroup Label ... end
Referenceref over A, B : title

PlantUML Cheat Sheet for Class and Object Diagrams

Class diagrams support the full UML 2.x notation including attributes, methods, visibility modifiers, and six relationship types. Object diagrams use the same syntax but with instances rather than class definitions.

Classes, Interfaces and Enums

ElementSyntax
Classclass ClassName
Abstract classabstract class Name
Interfaceinterface Name
Enumenum Color { RED\nGREEN\nBLUE }
Annotationannotation Name
Namespace / packagenamespace pkg.name { ... }
Spot (custom icon)class Name <<(S,#FF7700) Spot>>

Visibility Modifiers

SymbolVisibility
+Public
-Private
#Protected
~Package (default)

Relationships

RelationshipSymbolMeaning
Inheritance (extends)A <|-- BB extends A
Realization (implements)A <|.. BB implements A
CompositionA *-- BA is composed of B
AggregationA o-- BA aggregates B
AssociationA -- BA is associated with B
DependencyA ..> BA depends on B
CardinalityA "1" *-- "many" BLabel both ends

PlantUML Cheat Sheet for Activity and Use Case Diagrams

Activity diagrams (flowcharts) use a flow-based syntax with start, stop, actions, conditionals, loops, and parallel forks. Use Case diagrams define actors and scenarios with include and extend relationships.

Activity Diagram (New Syntax)

ElementSyntax
Start nodestart
End nodestop or end
Action:Action text;
Note in flow#note right ... end note
If / elseif (cond?) then (yes)\n...\nelse (no)\n...\nendif
While loopwhile (cond?) is (yes)\n...\nendwhile (no)
Repeat looprepeat\n...\nrepeat while (cond?)
Fork (parallel)fork\n...\nfork again\n...\nend fork
Swim lane|lane name|\n:Action;
Detachdetach
Arrow label-> label; after action

Use Case Diagram

ElementSyntax
Actor:Actor Name:
Use Case(Use Case Name)
Association:Actor: --> (Use Case)
Include(A) .> (B) : include
Extend(A) <. (B) : extend
Package (system box)package "System" { ... }
Notenote "text" as N\nA .. N

PlantUML Cheat Sheet for State, ER and Deployment Diagrams

State diagrams track object lifecycle through transitions. ER diagrams define data entities and their relationships using crow’s foot cardinality. Deployment diagrams map physical infrastructure with nodes, components, and links.

State Diagram

ElementSyntax
Initial state[*] --> StateName
Final stateStateName --> [*]
Transition with labelA --> B : trigger / action
Named statestate "Long Name" as S
Composite statestate S { A --> B }
Note on linknote on link ... end note
Concurrent statestate S { A\n--\nB }
History[H] --> S

ER Diagram

ElementSyntax
Entityentity "Name" as E { *pk : int\n--\nfield : type }
Primary key* field : type (asterisk = PK)
One-to-manyE1 }|--|{ E2 : label
Zero-or-oneE1 |o--|| E2
Zero-or-manyE1 }o--o{ E2
Cardinality key|o=zero/one, ||=one, }|=many

Deployment Diagram

ElementSyntax
Nodenode "Server" as N
Componentcomponent "App" as C
Databasedatabase "DB" as D
Cloudcloud "AWS" { ... }
Package grouppackage "Group" { ... }
Link with labelN --> C : HTTPS
Artifactartifact "app.jar" as A
Test any syntax from this cheat sheet — no install needed
Copy any code block above into our free PlantUML generator and render it instantly in your browser. Works for all 12+ diagram types.
Open Free Generator →

Wireframe, Mind Map and WBS Syntax at a Glance

PlantUML’s Salt extension renders UI wireframe mockups using a text-table syntax. Mind Map and WBS (Work Breakdown Structure) diagrams use indented bullet notation. All three use their own @start keyword instead of @startuml.

Salt Wireframe (UI Mockups)

ElementSyntax
Window title{* Window Title | content }
Button[ Button ]
Text input"input text"
Checkbox (unchecked)[]
Checkbox (checked)[X]
Radio (off)()
Radio (on)(X)
Tabs{/ Tab1 | Tab2 | Tab3 }
Tree node{ T | +-- item | +-- item }
Separator-- (horizontal line)

Mind Map

LevelSyntax
Root (level 1)* Root
Child (level 2)** Child
Grandchild (level 3)*** Grandchild
Left branch** Left branch (auto-placed)
Checkbox task[X] Done / [ ] Todo
Custom color[#lightblue] Node
Icon<&star> Node (OpenIconic)

WBS (Work Breakdown Structure)

LevelSyntax
Project root+ Project Name
Phase (level 2)++ Phase 1
Task (level 3)+++ Task 1.1
Subtask (level 4)++++ Subtask
Minus branch (left)-- Left branch
Completed task[#green] +++ Done

PlantUML Cheat Sheet: Themes and Skinparam Reference

This plantuml cheat sheet section covers the two styling systems: the built-in theme library (applied with !theme) and skinparam (individual property overrides). Use themes for quick visual changes and skinparam for precise control of colors, fonts, and borders on specific elements.

Applying a Theme

Add !theme THEME_NAME as the second line of your diagram, directly after @startuml. Themes affect all element colors, fonts, and borders globally and work with all diagram types.

cerulean
cerulean-outline
cyborg
cyborg-outline
sketchy
sketchy-outline
materia
materia-outline
minty
superhero
superhero-outline
hacker
sandstone
spacelab
united
lightgray
plain
metal
neon
solar
vapor
blueprint
carbon-gray
mimeograph

Use this visual theme gallery to preview all 40+ built-in themes side by side before choosing one for your diagrams.

Skinparam Quick Reference

Skinparam overrides individual style properties. Apply globally or per-element type. Prefix with the element type for targeted styling (e.g. skinparam SequenceArrow...).

Skinparam PropertyExample ValueEffect
skinparam backgroundColor#f8f8f8Diagram canvas background
skinparam ArrowColor#1a56dbAll arrow colors
skinparam ParticipantBackgroundColor#dbeafeSequence participant fill
skinparam ClassBackgroundColor#eff6ffClass box fill
skinparam ClassBorderColor#1a56dbClass box border
skinparam FontNameHelveticaGlobal font family
skinparam FontSize14Global font size (px)
skinparam FontColor#1e293bGlobal text color
skinparam ShadowingfalseDisable drop shadows
skinparam MonochrometrueBlack and white output
skinparam HandWrittentrueSketchy hand-drawn style
skinparam RoundCorner8Rounded corner radius
skinparam Padding5Element padding
skinparam dpi150Output resolution
💡 Skinparam vs !theme Use !theme when you want a consistent visual preset for the whole diagram. Use skinparam when you need to override specific colors or sizes that a theme does not control, or when you want to style only one element type (e.g. only sequence participants).

Export Formats, Output Options and File Types

PlantUML can export to multiple formats from the command line using the -t flag followed by the format code. SVG and PNG work in both server and local mode. PDF export requires local mode with Java installed. Run java -jar plantuml.jar followed by the flags below.

FormatCLI FlagNotes
PNG (default)-tpngWorks in all modes; best for documents
SVG-tsvgScalable; best for web and Confluence
PDF-tpdfRequires local Java mode
ASCII art-ttxtTerminal and plain-text output
Unicode ASCII-tutxtRicher ASCII with Unicode chars
EPS (PostScript)-tepsVector format for print
LaTeX / TikZ-tlatexFor LaTeX documents
Base64 PNG-tpng:base64Embed directly in HTML img tags
📄 Batch export all .puml files Run java -jar plantuml.jar -tsvg *.puml to export every diagram file in the current folder at once. Use the -o ./output/ flag to specify an output directory. This is the recommended approach for CI/CD documentation pipelines.

PlantUML Cheat Sheet: Common Errors and Quick Fixes

The plantuml cheat sheet below covers the eight most frequent errors developers encounter. Most errors fall into three categories: missing dependencies (Graphviz or Java), syntax mistakes, or size limit breaches. Test your syntax in our free PlantUML generator to confirm it works before debugging locally.

ErrorCauseFix
Cannot find Graphviz dotGraphviz not installed or not in system PATHInstall Graphviz + add to PATH, or switch to server mode (plantuml.render = PlantUMLServer)
Connection refused / timeoutServer mode with no internet, or wrong server URLCheck internet connection; verify server URL; switch to local mode if offline
Diagram too large / PLANTUML_LIMIT_SIZEPNG pixel dimensions exceed default 4096px limitAdd -DPLANTUML_LIMIT_SIZE=8192 to your Java command arguments
java.lang.OutOfMemoryErrorVery large diagram exceeds JVM heap limitAdd -Xmx1024m (or higher) to Java command; split large diagrams
unknown keyword / Syntax error on line NTypo in keyword or wrong element syntaxCheck exact keyword spelling at plantuml.com; verify @startuml/@enduml present
Error reading fileWrong file path or insufficient read permissionsCheck file path is correct and Java process has read access to the directory
Arrows or layout wrongDefault top-down layout not suited to diagramAdd left to right direction or use skinparam layoutEngine elk for complex graphs
Missing font / rendering artifactsRequired font not installed on the rendering machineInstall the font system-wide, or change skinparam FontName to a font that is available

For a full list of PlantUML themes, skinparam properties, and language keywords, the official PlantUML language reference PDF is the authoritative source — updated with every major release.

Quick-Start Guide for Non-Developers (PMs, Analysts, Students)

You do not need to be a developer to use PlantUML. Project managers, business analysts, technical writers, and students can create useful sequence and activity diagrams with just three syntax rules. Here is the fastest path to your first working diagram.

  • 1
    Open the Free Generator

    Go to our free PlantUML generator. No login, no install, no Java needed. It works in any browser on any device.

  • 2
    Write Your First Sequence Diagram

    Copy this starter template: @startuml → new line → Customer -> Support : Send ticket → new line → Support --> Customer : Confirm receipt → new line → @enduml. Paste it in and click Generate.

  • 3
    Add More Steps

    Each new line follows the pattern Name -> Name : message. Use --> for return arrows. Add title My Diagram after @startuml to add a title. That is all you need for a complete sequence diagram.

  • 4
    Apply a Theme

    Add !theme cerulean as the second line of your diagram. This changes the visual style instantly. Try !theme minty, !theme materia, or !theme sketchy to find a look that suits your audience.

  • 5
    Export Your Diagram

    Download your diagram as PNG for presentations and documents, or as SVG for websites and Confluence. For the VS Code workflow, see our plantuml editor vscode guide for the full IDE setup.

💡 Choosing between PlantUML and Mermaid? If your team works primarily on GitHub and wants diagrams that render natively in markdown files, read our PlantUML vs Mermaid comparison to decide which tool fits your workflow before investing time learning syntax.

Keep this plantuml cheat sheet bookmarked — every syntax table on this page works with the free online generator, in VS Code with the jebbs.plantuml extension, and in Confluence, GitLab, and CI/CD pipelines using the official Docker image or JAR file.

Put this plantuml cheat sheet to work right now
Paste any syntax from this page into our free generator and see your diagram in seconds — sequence, class, ER, activity, state and more.
Generate Free Diagrams →

PlantUML Cheat Sheet — Frequently Asked Questions

What is a PlantUML cheat sheet and where can I find one?

A plantuml cheat sheet is a quick-reference guide that lists PlantUML syntax commands, diagram type keywords, and styling options in one place. This page is a comprehensive plantuml cheat sheet covering all 12+ diagram types, themes, skinparam, export formats, and error fixes — all free to use with no download required.

How do I start a PlantUML diagram?

Every PlantUML diagram starts with @startuml and ends with @enduml. Between those markers, write your diagram syntax depending on the type you need. Sequence diagrams use A -> B : message. Class diagrams use class Name { ... }. Activity diagrams start with start and end with stop.

What are the most common PlantUML syntax errors?

The most common errors are: missing @startuml / @enduml markers, Graphviz not found (when using local mode), diagram too large (fix with -DPLANTUML_LIMIT_SIZE=8192), and typos in keywords. Use our free online generator to test syntax — it shows errors immediately without any local setup.

How do I change the theme in PlantUML?

Add !theme THEME_NAME as the second line of your diagram, directly after @startuml. For example: !theme cerulean applies the cerulean blue theme. PlantUML has 40+ built-in themes including cerulean, materia, sketchy, cyborg, superhero, minty, and sandstone. Preview all themes at the-lum.github.io/puml-themes-gallery before choosing.

What is skinparam in PlantUML?

Skinparam is PlantUML’s CSS-like styling system for controlling individual element appearance. Use it to set background colors (skinparam ClassBackgroundColor #eff6ff), font sizes, arrow colors, border widths, and more. Skinparam can target all elements globally or specific element types. It works alongside !theme — skinparam overrides win over theme defaults.

Can I use PlantUML to create flowcharts?

Yes — PlantUML’s Activity diagram type is its flowchart system. Use start, stop, :Action;, if (condition?), while, and fork to build any flowchart. PlantUML activity diagrams also support swim lanes using the |lane name| syntax for cross-functional process maps.

What is the difference between -> and –> in PlantUML sequence diagrams?

In sequence diagrams, -> draws a solid arrow (used for calls and requests) and --> draws a dashed arrow (used for responses and return values). This matches UML 2 notation where solid arrows represent synchronous calls and dashed arrows represent return messages. Use ->> for async solid arrows and -->> for async dashed arrows.

How do I export a PlantUML diagram to PDF?

PDF export requires local rendering mode with Java installed. Run java -jar plantuml.jar -tpdf diagram.puml in the command line. In VS Code, open the command palette, run PlantUML: Export Current Diagram, and select PDF. PNG and SVG work in all modes including server mode and the free online generator.

Is there a PlantUML cheat sheet PDF I can download?

The official PlantUML Language Reference Guide PDF is the most complete downloadable reference, covering all diagram types in full detail. For a quick reference, bookmark this page — it covers the most-used syntax for all 12+ diagram types on a single scrollable page, and all examples work directly in our free online generator.

J
Joshua

SEO strategist and founder of AI Tool Synergy. Focused on building topical authority through data-driven content and free tools that actually work. Explore all free tools at aitoolsynergy.com/free-tools-online — no signup ever required.