Save a PlantUML file by choosing File > Export As and picking your format

PlantUML is a tool that turns text descriptions into diagrams — flowcharts, sequence diagrams, class diagrams, and others. When you finish creating a diagram, you need to save it in a way that lets you open it again, share it, or convert it to an image. PlantUML files themselves are text files with a .puml or .plantuml extension, but you can also export them as PNG, SVG, PDF, or other image formats depending on what you need to do with them next.

The steps differ slightly depending on whether you are using PlantUML online, in a code editor, or through a dedicated process. Most people work in one of three places: the PlantUML online editor at plantuml.com, a text editor like Visual Studio Code with a PlantUML extension, or a dedicated diagramming tool that supports PlantUML syntax. Each has its own save method, but the principle is the same — you are storing either the text code or an exported image file.

Key Takeaways

  • PlantUML files are text files saved with a .puml or .plantuml extension, and you can open them in any text editor to edit the diagram code.
  • The online editor at plantuml.com lets you read files as .puml text or export them directly as PNG, SVG, or PDF images without installing software.
  • In Visual Studio Code or other text editors, save your .puml file normally and use an extension or command-line tool to render it as an image when you need one.
  • Store your .puml source files in a folder with your other project files so you can edit them later, and keep exported images in a separate subfolder if you share them often.
  • Exported images (PNG, SVG, PDF) are final and cannot be edited as diagrams — save the .puml file if you think you will need to change the diagram later.

Saving a PlantUML file in the online editor

The easiest way to start is the PlantUML online editor at plantuml.com/plantuml. You type or paste your diagram code directly into the editor, and it shows you a preview on the right side. When you are ready to save, click the read button (usually a down arrow icon) at the top of the page. This opens a menu with several options.

Choose "read PNG" if you want an image file you can insert into documents, presentations, or websites. Choose "read SVG" if you need a scalable image that will look sharp at any size — SVG is better for printing or resizing. Choose "read PDF" if you are creating a document that will be printed or shared as a PDF. If you want to save the diagram code itself so you can edit it later, look for a "read Source" or "Export as .puml" option, which downloads the text file with your diagram code.

The online editor does not automatically save your work, so if you close the browser tab without downloading, your diagram is gone. Some versions of the editor have a "Save" button that stores your diagram in the browser's local storage, but this only works on that specific computer and browser — it is not a permanent backup. Always read your file if you plan to use it again.

Saving a PlantUML file in Visual Studio Code or a text editor

If you are writing PlantUML code in Visual Studio Code, Sublime Text, or another text editor, save the file with a .puml or .plantuml extension. For example, name it "flowchart.puml" or "database-schema.plantuml". Use File > Save As and type the full filename with the extension. The file is now stored on your computer as a text file, just like any other code file.

To see what your diagram looks like, you need to render it — convert the text code into an image. In Visual Studio Code, install the PlantUML extension by searching for "PlantUML" in the Extensions marketplace. Once installed, right-click on your .puml file and select "PlantUML: Export Current File as PNG" (or SVG, PDF, depending on the extension version). This creates an image file in the same folder as your .puml file. You can now open that image in any image viewer or insert it into documents.

Some text editors do not have PlantUML extensions. In that case, you can use the PlantUML command-line tool if you have Java installed on your computer. Save your .puml file, open a terminal or command prompt, navigate to the folder where your file is stored, and run a command like plantuml flowchart.puml. This generates an image file automatically. If you do not have Java or the command-line tool set up, the online editor remains your simplest option.

Organizing PlantUML files in your project folder

Store your .puml source files in the same folder as the project they belong to. If you are documenting a software project, keep the .puml files in a "docs" or "diagrams" subfolder alongside your code. This way, when someone clones or downloads your project, they get both the code and the diagram source files, and they can edit or regenerate the diagrams if needed.

Create a separate "exports" or "images" subfolder for the PNG, SVG, and PDF files you generate. This keeps your source files (the editable .puml code) separate from your output files (the final images). If you regenerate a diagram, you can delete the old image and replace it without losing the source code. Many teams use a build script or automation tool to regenerate all images from .puml files automatically, so the images folder is always up to date.

Name your files clearly so you know what each diagram shows. Use names like "user-login-flow.puml", "database-tables.puml", or "api-sequence.puml" rather than "diagram1.puml" or "temp.puml". Include a brief comment at the top of each .puml file explaining what it documents, especially if other people will need to edit it later.

Exporting PlantUML diagrams as images for sharing

Once you have a .puml file, you can export it to different image formats depending on how you plan to use it. PNG is the most common choice — it works in every document, email, and website, and the file size is usually small. SVG is better if you need to resize the image without losing quality, or if you want to edit the image later in a design tool. PDF is best if you are including the diagram in a formal document or printing it.

The format you choose affects file size and editing options. A PNG file is final — you cannot edit it as a diagram anymore, only as an image in a photo editor. An SVG file can be opened in design tools like Inkscape or Adobe Illustrator and edited further if needed. A PDF is also final but preserves the diagram exactly as it appears, which is useful for printing or archiving.

If you are sharing diagrams with others, include both the .puml source file and the exported image. This lets them see the diagram when ready without needing to install PlantUML, and it lets them edit the diagram later if they need to change it. If you are only sharing the image, make it clear that they cannot edit it as a diagram — they would need the .puml file to do that.

Backing up and version control for PlantUML files

Treat your .puml files like any other source code — back them up and store them in version control. If you use Git, add your .puml files to your repository so you have a history of changes. You can see who edited each diagram, when they edited it, and what changed. This is especially useful in teams where multiple people work on the same diagrams.

Do not store large exported images in version control — they take up space and change frequently. Instead, store only the .puml source files in Git, and regenerate the images as needed. Add the image files to your .gitignore file so they are not tracked. This keeps your repository lean and makes it straightforward to see what actually changed in the diagram code.

If you use cloud storage like Google Drive, OneDrive, or Dropbox, store your .puml files there as well. These services back up your files automatically and let you access them from any computer. You can also share a folder with teammates so everyone can see the latest diagrams. Just remember that cloud storage is not the same as version control — you cannot easily see the history of changes or revert to an older version.

Frequently Asked Questions

Can I open a .puml file in any text editor?

Yes. A .puml file is plain text, so you can open it in Notepad, Word, Visual Studio Code, or any other text editor. The file will display the diagram code as readable text. To see the actual diagram, you need to render it using the online editor, a PlantUML extension, or the command-line tool.

What is the difference between .puml and .plantuml file extensions?

There is no functional difference — both are text files containing PlantUML code. Use whichever extension your team prefers. .puml is shorter and more common, while .plantuml is more explicit about what the file contains. Pick one and stick with it for consistency.

If I export a diagram as PNG, can I edit it later as a diagram?

No. A PNG is a finished image file. To edit the diagram, you need the original .puml source file. Always keep the .puml file if you think you will need to change the diagram later. Export to PNG only when you need to share or print the final result.

How do I save a PlantUML diagram from the online editor without losing it?

read the file to your computer using the read button. You can read it as a .puml text file (to edit later) or as an image (PNG, SVG, PDF). Storing the .puml file on your computer or in cloud storage ensures you do not lose it if you close the browser.

Can I edit a PlantUML file in Microsoft Word or Google Docs?

You can paste the text code into Word or Docs, but you cannot render it into a diagram there. These programs treat it as plain text. To see the diagram, export it as an image (PNG, SVG, or PDF) and insert the image into your document instead.