PlantUML

PlantUML
Original author(s) Arnaud Roques
Developer(s) Arnaud Roques
Initial release 17 April 2009
Stable release
1.2023.6 / 18 April 2023
Repository
Written in Java
Operating system Linux, OS X, Windows
Type UML tool
License GNU General Public License
Website plantuml.com
Plantuml
Filename extension
.pu, .puml, .txt
Type of format Textual

PlantUML is an open-source tool allowing users to create diagrams from a plain text language. Besides various UML diagrams, PlantUML has support for various other software development related formats (such as Archimate, Block diagram, BPMN, C4, Computer network diagram, ERD, Gantt chart, Mind map, and WBD), as well as visualisation of JSON and YAML files.

The language of PlantUML is an example of a domain-specific language. Besides its own DSL, PlantUML also understands AsciiMath, Creole, DOT, and LaTeX. It uses Graphviz software to lay out its diagrams and Tikz for LaTeX support. Images can be output as PNG, SVG, LaTeX and even ASCII art. PlantUML has also been used to allow blind people to design and read UML diagrams.

Applications that use PlantUML

There are various extensions or add-ons that incorporate PlantUML.

  • Atom has a community maintained PlantUML syntax highlighter and viewer.
  • Confluence wiki has a PlantUML plug-in for Confluence Server, which renders diagrams on-the-fly during a page reload. There is an additional PlantUML plug-in for Confluence Cloud.
  • Doxygen integrates diagrams for which sources are provided after the startuml command.
  • Eclipse has a PlantUML plug-in.
  • Google Docs has an add-on called PlantUML Gizmo that works with the PlantUML.com server.
  • IntelliJ IDEA can create and display diagrams embedded into Markdown (built-in) or in standalone files (using a plugin).
  • LaTeX using the Tikz package has limited support for PlantUML.
  • LibreOffice has Libo_PlantUML extension to use PlantUML diagrams.
  • MediaWiki has a PlantUML plug-in which renders diagrams in pages as SVG or PNG.
  • Microsoft Word can use PlantUML diagrams via a Word Template Add-in. There is an additional Visual Studio Tools for Office add-in called PlantUML Gizmo that works in a similar fashion.
  • NetBeans has a PlantUML plug-in.
  • Notepad++ has a PlantUML plug-in.
  • Obsidian has a PlantUML plug-in.
  • Org-mode has a PlantUML org-babel support.
  • Rider has a PlantUML plug-in.
  • Sublime Text has a PlantUML package called PlantUmlDiagrams for Sublime Text 2 and 3.
  • Visual Studio Code has various PlantUML extensions on its marketplace, most popular being PlantUML by jebbs.
  • Vnote open source notetaking markdown application has built in PlantUML support.
  • Xcode has a community maintained Source Editor Extension to generate and view PlantUML class diagrams from Swift source code.

Text format to communicate UML at source code level

PlantUML uses well-formed and human-readable code to render the diagrams.

There are other text formats for UML modelling, but PlantUML supports many diagram types, and does not need an explicit layout, though it is possible to tweak the diagrams if necessary.

Example

The source code for the class diagram shown on the right is as follows:

UML Class diagram showing an example of the Facade design pattern.
skinparam style strictuml
class Façade {
 doSomething()
}
Façade .> package1.Class1
Façade .> package2.Class2
Façade .> package3.Class3
Client1 .> Façade : doSomething()
Client2 .> Façade : doSomething()
note as N2
doSomething() {
  Class1 c1 = newClass1();
  Class2 c2 = newClass2();
  Class3 c3 = newClass3();
  c1.doStuff(c2)
  c3.setX(c1.getX());
  return c3.getY();
}
end note
Façade .. N2

See also