How to Save a PlantUML File: Formats, Tools, and Storage Options

PlantUML is a text-based diagramming tool that turns plain markup into visual diagrams — flowcharts, sequence diagrams, class diagrams, and more. Because diagrams are defined in plain text, saving your work is straightforward in principle, but the right way to save depends heavily on what you plan to do with the output. There's a meaningful difference between saving your source file and saving the rendered image, and most users need both.

Understanding the Two Types of PlantUML Files

Before saving anything, it helps to know what you're actually producing.

Source files (.puml or .txt) contain the PlantUML markup — the text instructions that describe your diagram. These are lightweight, human-readable, and version-control friendly. A typical source file looks like this:

@startuml Alice -> Bob: Hello Bob --> Alice: Hi back @enduml 

Rendered output files are the images PlantUML generates from that source — commonly .png, .svg, or .pdf. These are what you'd embed in documentation, share with a team, or insert into a presentation.

Most workflows involve both: you keep the source file for editing and regeneration, and you export rendered images for sharing.

How to Save a PlantUML Source File

In a Text Editor or IDE

PlantUML source files are plain text. If you're writing in VS Code, IntelliJ, Eclipse, or any other editor with PlantUML support, saving is exactly the same as saving any text file — Ctrl+S (Windows/Linux) or Cmd+S (macOS).

The file extension matters for tooling:

  • .puml — the most widely recognized PlantUML-specific extension
  • .plantuml — also supported by most plugins
  • .txt — works but offers no syntax highlighting or plugin recognition
  • .pu — a shorter alternative used in some setups

Best practice: Use .puml unless your toolchain requires otherwise. Most IDE plugins, documentation systems, and CI/CD integrations look for this extension by default.

In the PlantUML Online Server

The PlantUML online editor doesn't provide a traditional "save" button for source files. Instead, it encodes your diagram into the URL. To save your source:

  1. Copy your markup text directly from the editor
  2. Paste it into a local .puml file using any text editor
  3. Bookmark the encoded URL if you want quick access to that diagram state

The encoded URL is a form of portable save state, but it's not a substitute for a proper local or cloud-stored source file.

How to Save the Rendered Output 🖼️

Exporting from the Command Line

If you're running PlantUML locally via the JAR file, rendering and saving output is handled through command-line flags:

CommandOutput Format
java -jar plantuml.jar diagram.pumlPNG (default)
java -jar plantuml.jar -tsvg diagram.pumlSVG
java -jar plantuml.jar -tpdf diagram.pumlPDF
java -jar plantuml.jar -ttxt diagram.pumlASCII art

The output file is saved automatically in the same directory as the source file, using the same base filename. You can specify an output directory with the -o flag.

Exporting from IDE Plugins

Most PlantUML IDE plugins include a preview pane with an export or save option. In VS Code with the PlantUML extension, right-clicking the preview panel gives you options to export as PNG, SVG, or other formats to a directory of your choice.

From the Online Server

On the PlantUML web editor, once your diagram renders:

  • Right-click the image and choose Save image as to grab the PNG
  • Use the SVG or other format links provided below the diagram for vector output

Choosing the Right Output Format

The format you save in affects how the file behaves downstream.

FormatBest ForEditable After Export
PNGDocs, slides, quick sharingNo
SVGWeb embeds, scalable graphicsYes (in vector editors)
PDFPrint, formal documentationLimited
ASCIITerminal output, plain-text docsYes

SVG is generally preferable when you need diagrams to scale cleanly — it's a vector format, so it renders crisply at any resolution. PNG is simpler for quick use but loses quality at non-native sizes.

Storing PlantUML Files in a Team or Cloud Environment ☁️

Because PlantUML source files are plain text, they integrate naturally with standard storage and collaboration workflows:

  • Git repositories — Source files version beautifully. Teams can diff changes, review updates, and regenerate diagrams from any commit.
  • Cloud storage (Google Drive, Dropbox, OneDrive) — Works fine for personal use or small teams, though you lose the diff and version history advantages of Git.
  • Documentation systems (Confluence, Notion, GitBook) — Some support PlantUML rendering natively or through plugins, meaning you can store source inline and render on demand.
  • CI/CD pipelines — PlantUML can be integrated into build processes so diagrams are automatically regenerated and saved whenever source files change.

Variables That Shape the Right Approach

The "correct" way to save PlantUML files shifts depending on several factors:

  • Solo vs. team use — A solo developer saving to a local folder has very different needs than a documentation team requiring versioned, auto-rendered diagrams in a pipeline
  • How diagrams are consumed — Embedding in a web app favors SVG; inserting into Word or PowerPoint usually means PNG
  • Whether diagrams change frequently — High-churn diagrams benefit from source-based workflows where re-rendering is automated
  • Technical environment — Whether you're using a local JAR, a Docker-based PlantUML server, an IDE plugin, or a hosted service changes which save options are available to you
  • File organization scale — A handful of diagrams can live anywhere; hundreds of diagrams across a large project benefit from a structured naming convention and output directory strategy

The mechanics of saving a PlantUML file are simple — it's plain text, and any text editor will do. But the decisions around format, storage location, rendering pipeline, and organization all depend on the specifics of how you and your team actually use diagrams day to day.