PlantUML Preview
Draw PlantUML sequence, class, activity and ER diagrams as you type.
The official engine runs in your browser, so no Java and no server. Save as SVG or PNG.
Type PlantUML source on the left, and the diagram is drawn on the right as soon as you pause.
The samples cover sequence, activity, class, use case, state, ER, Gantt, mind map and JSON diagrams.
If the source has a mistake, the tool shows the line number and the line itself.
PlantUML Preview: Features
What PlantUML is
PlantUML is open-source software that turns plain-text descriptions into UML and other diagrams. Arnaud Roques has led its development since 2009.
Because diagrams are text, you can keep them in Git, review changes as diffs, and let PlantUML decide where boxes and lines go.
Besides the nine samples here, PlantUML draws component, deployment and timing diagrams, WBS charts and more.
The official documentation explains every syntax, for example the sequence diagram page.
PlantUML vs Mermaid
Mermaid also draws diagrams from text. The biggest practical difference is GitHub support.
- GitHub renders Mermaid inside Markdown. According to GitHub's documentation, the supported syntaxes are Mermaid, GeoJSON, TopoJSON and ASCII STL. PlantUML is not one of them.
- PlantUML covers more kinds of UML diagrams and offers fine-grained styling with
skinparam.
Choose Mermaid when the diagram should live directly in GitHub Markdown, and PlantUML when you need detailed UML or already have PlantUML files.
You can try Mermaid in the Mermaid Preview.
How this differs from VS Code and the official server
To render locally, the PlantUML extension for VS Code needs Java, and on macOS and other systems Graphviz as well (the Windows version of the extension includes Graphviz). Otherwise it can send the source to a PlantUML server for rendering.
The official PlantUML Web Server compresses your source into the URL and draws the diagram on the server.
This tool runs @plantuml/core, the official browser build of the PlantUML engine, served from this site. Graphviz is included in it, so nothing needs to be installed, and your source never leaves the browser.
Common sequence diagram syntax
These are the constructs you will use most in sequence diagrams. The "Sequence" sample uses all of them.
| Syntax | Meaning |
|---|---|
@startuml … @enduml | Start and end of the diagram (optional in this tool) |
A -> B : text | Solid arrow from A to B |
A --> B : text | Dashed arrow, often used for replies |
note right of A : text | Note to the right of A |
alt condition … else … end | Alternative flows |
loop condition … end | Repetition |
' text | Comment (not drawn) |
What this tool does not support
To keep your diagrams inside the browser, features that load something from elsewhere are turned off. If you use one, the tool tells you which line.
- The standard library, such as C4 and AWS (
!include <C4/C4_Context>and so on) - Loading other files or files on other sites (
!include,!import,!theme … from) - Emoji such as
<:smile:>
Some diagram types are not part of the browser engine. If you use one, the tool tells you that it cannot be drawn.
- ditaa (
@startditaa), Graphviz DOT (@startdot) and a few others - Math formulas (
@startmath,@startlatex).<math>and<latex>inside a diagram appear as plain text, not as formulas
Diagrams larger than 32,768 px in either direction cannot be drawn. Split them into smaller diagrams.
Images from other sites (<img:https://…>) are not shown either.
If the source contains more than one @startuml, only the first diagram is drawn.
!theme and the built-in icons (such as <&account-login>) do work. Both are loaded from this site.
PlantUML Preview: FAQ
Does a saved SVG contain my source?
No. PlantUML normally embeds the compressed source, including comment lines that are not drawn, inside every SVG it creates.
This tool removes it before showing and saving the diagram, so sharing the image does not share your comments.
Why does text look shifted when I open the SVG on another computer?
PlantUML's SVG asks for the generic sans-serif font, and text widths are measured with the fonts of the browser that drew the diagram. On a system with different fonts, text can overflow its boxes.
If the diagram must look the same everywhere, use "Save PNG". PNG files are drawn at twice the size, or smaller for very large diagrams so that they fit within browser limits.
Can I use the diagrams in work documents or on public pages?
According to PlantUML's license text, images generated by PlantUML are owned by the author of the source, and you do not even have to mention that they were made with PlantUML.
If the source itself is covered by another license, the images are covered by that same license.
How do I show a PlantUML diagram in a GitHub README?
GitHub does not render PlantUML, so save the diagram as SVG or PNG here and add it as an image.
If you want the diagram to stay as text inside Markdown, write it in Mermaid instead. You can try it in the Mermaid Preview.
Is my source saved?
It is kept automatically in this browser (localStorage), so you can continue next time. It does not move to other browsers or devices.
Press "Clear" to delete it.
How to Use PlantUML Preview
-
Pick a sample or write your own
Choose a diagram type from "Samples", or type PlantUML source in the box on the left.
-
Check the diagram
When you pause typing, the diagram appears on the right. If there is a mistake, the tool shows the line number and the line. For a wide diagram, press "Actual size" below it to see it without shrinking.
-
Save it as SVG or PNG
Use "Save SVG" or "Save PNG". "Copy SVG" copies the SVG markup itself.
Category Design