Mr. Tools

How to

How to use PlantUML Preview

A tool for drafting PlantUML syntax and checking the preview in the same workspace. It is useful when you want to review the structure of sequence diagrams or class diagrams. Theme switching and multiple-page management are also available for comparing diagram variations.

PlantUML Preview thumbnailPlantUML Preview thumbnail

Use Cases

When to use it

  • Draft UML diagrams in code
  • Check the structure before pasting a diagram into a document
  • Compare several versions of a diagram by switching tabs
  • Quickly check a class or state diagram in code
  • Tidy up a UML diagram's structure before sharing it with your team
  • Check how a diagram looks before pasting it into a specification

Capabilities

What this tool can do

  • Check PlantUML code and its preview side by side
  • Switch the preview theme
  • Keep your code on multiple pages
  • Save as SVG or PNG and copy to the clipboard
  • Manage separate diagrams on separate pages
  • Draw sequence, class, state and other major UML diagrams

Guide

How to use each screen area

Learn how to use each screen area, including settings, input, previews, results, and saving.

01 HOWTO

Syntax editor area

Write PlantUML syntax in the left editor. Start from a diagram template, add context-aware insert suggestions, and check the structure in the preview as you edit.

Screen showing Syntax editor area in PlantUML PreviewScreen showing Syntax editor area in PlantUML Preview

What this area does

  • Enter PlantUML syntax directly
  • Insert a starter template for the diagram type
  • Add suggestions that match the current diagram type
  • Fix input while checking preview errors

Where to use it

01
Syntax input

Enter PlantUML syntax for sequence diagrams, class diagrams, state diagrams, and other diagrams.

Screen showing where to use Syntax input in PlantUML PreviewScreen showing where to use Syntax input in PlantUML Preview
02
Template selection

When the editor is empty, choose a diagram type and insert the basic @startuml to @enduml structure.

Screen showing where to use Template selection in PlantUML PreviewScreen showing where to use Template selection in PlantUML Preview
03
Input suggestions

Add matching items such as participants, messages, classes, or relationships at the cursor position.

Screen showing where to use Input suggestions in PlantUML PreviewScreen showing where to use Input suggestions in PlantUML Preview
04
Error review

When the syntax has a problem, use the preview-side message to correct the input.

Screen showing where to use Error review in PlantUML PreviewScreen showing where to use Error review in PlantUML Preview

02 HOWTO

Input suggestions and editor tools

Use the templates and suggestions above the editor, the history control in the top bar, and clear or copy actions in the editor header. This area helps you create a base diagram, add parts, and reuse a draft.

Screen showing Input suggestions and editor tools in PlantUML PreviewScreen showing Input suggestions and editor tools in PlantUML Preview

What this area does

  • Insert a template for the diagram type
  • Add parts that match the current diagram
  • Return to a recent editing state from history
  • Clear or copy the current syntax

Where to use it

01
Templates

Choose a starter structure for a sequence diagram, class diagram, state diagram, or another diagram type.

Screen showing where to use Templates in PlantUML PreviewScreen showing where to use Templates in PlantUML Preview
02
Suggestions

Add parts such as participants, messages, classes, or relationships that fit the current syntax.

Screen showing where to use Suggestions in PlantUML PreviewScreen showing where to use Suggestions in PlantUML Preview
03
History and draft

The browser keeps your current draft, and the history menu lets you return to a recent editing state.

Screen showing where to use History and draft in PlantUML PreviewScreen showing where to use History and draft in PlantUML Preview
04
Clear input

Remove the current syntax and start a new diagram.

Screen showing where to use Clear input in PlantUML PreviewScreen showing where to use Clear input in PlantUML Preview
05
Copy syntax

Copy the draft syntax into a README, specification, or external note.

Screen showing where to use Copy syntax in PlantUML PreviewScreen showing where to use Copy syntax in PlantUML Preview

03 HOWTO

Preview and theme area

Use the right preview pane to confirm the rendered PlantUML diagram and switch the theme before sharing. If rendering fails, the error appears in this same area.

Screen showing Preview and theme area in PlantUML PreviewScreen showing Preview and theme area in PlantUML Preview

What this area does

  • Switch the preview theme
  • Confirm the rendered diagram
  • Review rendering errors
  • Return to the input and revise the syntax

Where to use it

01
Switch theme

Change the background and line colors to match where the diagram will be shared.

Screen showing where to use Switch theme in PlantUML PreviewScreen showing where to use Switch theme in PlantUML Preview
02
Review diagram

Check whether the PlantUML syntax renders into the intended diagram.

Screen showing where to use Review diagram in PlantUML PreviewScreen showing where to use Review diagram in PlantUML Preview
03
Review errors

When the diagram cannot render, read the error message before editing the syntax.

Screen showing where to use Review errors in PlantUML PreviewScreen showing where to use Review errors in PlantUML Preview
04
Edit input

Use the preview result as feedback while revising the syntax in the editor.

Screen showing where to use Edit input in PlantUML PreviewScreen showing where to use Edit input in PlantUML Preview

04 HOWTO

Output format, copy, and download area

Use the output controls above the preview to choose SVG or PNG, then copy or download the rendered diagram. If export is not available, review the error and return to the input.

Screen showing Output format, copy, and download area in PlantUML PreviewScreen showing Output format, copy, and download area in PlantUML Preview

What this area does

  • Choose SVG or PNG as the output format
  • Copy the rendered diagram as an image
  • Download the rendered diagram as a file
  • Copy the original PlantUML syntax
  • Review errors when export is not possible

Where to use it

01
Output format

Switch between SVG and PNG depending on where you will share or paste the diagram.

Screen showing where to use Output format in PlantUML PreviewScreen showing where to use Output format in PlantUML Preview
02
Copy image

Copy the rendered diagram in the selected format and paste it into a document or chat.

Screen showing where to use Copy image in PlantUML PreviewScreen showing where to use Copy image in PlantUML Preview
03
Download image

Save the rendered diagram as an SVG or PNG file.

Screen showing where to use Download image in PlantUML PreviewScreen showing where to use Download image in PlantUML Preview
04
Copy syntax

Copy the PlantUML syntax used to create the diagram and share it with the image.

Screen showing where to use Copy syntax in PlantUML PreviewScreen showing where to use Copy syntax in PlantUML Preview
05
Review errors

When the diagram cannot be exported, check the error and return to the input.

Screen showing where to use Review errors in PlantUML PreviewScreen showing where to use Review errors in PlantUML Preview

Notes

Notes

Important points are grouped with reasons so you can make decisions before using the tool.

確認すること

記法の一部を一時的に外すにはコメントを使う

PlantUML では、行頭に ' を付けるとその行がコメントになります。複数行は /' と '/ で囲みます。図が表示されない時に疑わしい行をコメントにすると、原因を絞り込めます。

確認すること

最小の記法から始めて図が出る状態を先に確認する

要素を一度に増やすと、構文ミスと接続ミスの切り分けが難しくなります。まずは短いシーケンスやクラス関係だけで表示を確認すると進めやすいです。

確認すること

共有先に合わせて SVG と PNG を使い分ける

編集前提なら SVG、チャットや資料へ貼るなら PNG というように、出力形式を先に決めると手戻りが減ります。

確認すること

入力した記法は PlantUML の公開サーバーへ送られる

図の生成に www.plantuml.com を使うため、入力した記法はこのサイトのサーバーを経由して送信されます。社外秘の情報は記法に含めないでください。接続できない環境ではプレビューが表示されません。

FAQ

Questions about PlantUML Preview

Questions that make decisions easier before use are summarized first.

How is it different from Mermaid?

It suits times when you want to work on UML diagrams with PlantUML syntax. PlantUML is a different notation from Mermaid, so you can choose between them for each document.

Can I save the diagram as an image right away?

You can copy or save it as SVG or PNG once the diagram is drawn, which depends on the connection to the PlantUML server. If the connection is not available, the Preview area shows an error.

What kinds of diagrams can I draw?

Sequence diagrams, class diagrams, state diagrams, use case diagrams, Gantt charts and other major PlantUML diagrams.

Where can I look up the syntax?

The official PlantUML documentation explains the syntax for each diagram type. On this page, you can type the syntax and check the diagram as you go.

How do I share a diagram as an image?

Download it as SVG or PNG, or copy it to the clipboard, and share it from there.

Can I use it offline?

The PlantUML preview needs a connection to an outside server. Without a connection, the preview does not appear.

Is what I enter sent outside this site?

Yes. Diagrams are drawn by the public PlantUML server (www.plantuml.com), so the code you enter is sent there through this site's server. Do not include confidential information in your code.

Next guides

Related guides

Related guides are listed next so you can continue without getting lost.