Unframe

What is a .pub file?

Two very different things end in .pub. Most of the time it is a document made in Microsoft Publisher, a flyer, newsletter or brochure. The other kind is a public key that SSH and Git use to log in, and a computer can show you the same extension for both.

Last checked: October 28, 2026, against Microsoft's own pages and the sources listed at the end. Not affiliated with Microsoft.

Which kind do you have?

The two kinds of .pub file
KindWhere it came fromHow to tell
Microsoft Publisher documentSomeone saved a flyer, newsletter, brochure, card or calendar in Microsoft Publisher.Tens or hundreds of kilobytes or more. A text editor shows unreadable symbols.
SSH public keyThe key generator for SSH, ssh-keygen, wrote it next to a private key. Developers add it to GitHub, GitLab or a server.A few hundred bytes. A text editor shows one line that starts with a word like ssh-ed25519 or ssh-rsa, then a long string of letters and numbers.

If you are not sure, choose the file in Unframe. If it is a key, Unframe says so and does not try to open it.

A Publisher .pub file

Publisher is Microsoft's desktop publishing program for page layouts, and .pub is its file type. Microsoft says Publisher reaches end of life in October 2026 and is no longer part of Microsoft 365 (Microsoft Publisher will no longer be supported after October 2026). The files stay on your computer; what stops is Publisher's ability to open them in a Microsoft 365 install. The dates are in Publisher retirement: dates and your .pub files.

How to open one without Publisher:

Inside, a Publisher file is a container in the old Microsoft Office compound file format. In it sit separate parts for the page and shape index, the text, the shape positions and the pictures. That is why a reader can pull the text and pictures out without drawing the page, and why drawing the page exactly is the hard part.

An SSH public key

When you run ssh-keygen, it makes two files. The OpenSSH manual says the program asks for a file in which to store the private key, and that "The public key is stored in a file with the same name but “.pub” appended" (ssh-keygen(1)). The .pub file holds the public key: it is safe to share and is what you paste where a service asks for an SSH public key. GitHub's guide says to "add the SSH public key to your account" (Generating a new SSH key and adding it to the ssh-agent).

If it is neither

If a .pub file is neither a Publisher document nor a one-line key, ask where it came from, or open it in a text editor to see whether it holds readable text.

Open a .pub file

Choose the file and get its text and pictures back, page by page, with a Word file to save. It runs in your browser and nothing is uploaded.

Questions

What program opens a .pub file?

A Publisher document opens in Microsoft Publisher on Windows. Without Publisher, LibreOffice Draw, Scribus and Unframe can read it. An SSH public key is plain text: any text editor opens it.

Why does my .pub file look like one line of text?

It is probably an SSH public key. Those are a single line that starts with a key type such as ssh-ed25519 or ssh-rsa. You paste it where a service asks for a public key.

Is a .pub file an ebook?

Not usually. Ebooks use .epub. A .pub file is a Publisher document or an SSH public key.

Sources: Microsoft Support: Microsoft Publisher will no longer be supported after October 2026; OpenBSD manual: ssh-keygen(1); GitHub Docs: Generating a new SSH key and adding it to the ssh-agent; Born City, October 17, 2026: Microsoft Publisher discontinued, LibreOffice Draw opens only files up to 2010 (in German). Last checked: October 28, 2026. Unframe is an independent tool by Peak Apps Studio and is not affiliated with Microsoft. Microsoft and Publisher are trademarks of Microsoft Corporation.