.pub file: Publisher document or SSH key?
Two very different files share the .pub extension: Microsoft Publisher publications and SSH public keys. Here's how to tell them apart and open each one.
The .pub extension is used by two completely different kinds of file:
- Microsoft Publisher publications: newsletters, flyers, cards. Usually tens or hundreds of kilobytes, with names like
newsletter-may.pub. - SSH public keys: tiny text files (under 1 KB) used to sign in to servers, named like
id_rsa.puborid_ed25519.puband usually kept in a.sshfolder.
How to tell them apart
Open the file with Notepad (right-click › Open with › Notepad). An SSH key is a single line of readable text that starts with ssh-rsa, ssh-ed25519 or ecdsa-sha2. A Publisher file shows unreadable characters.
Opening an SSH public key
There's nothing to convert: it's plain text. Copy it from Notepad when a service (GitHub, a hosting provider, a server) asks for your public key. Never share the file with the same name but without .pub (for example id_ed25519): that one is the private key.
Opening a Publisher file
Use PUB Viewer on Windows. If you open an SSH key with it by mistake, it tells you so instead of showing an error.

More guides
- How to open a .pub file without Microsoft PublisherEvery way to view a Publisher file now that Publisher has been retired.
- How to convert a Publisher (.pub) file to PDFTurn a publication into a PDF anyone can open, at its real page size.
- Microsoft Publisher has been retired: what to do with your .pub filesView, archive and keep using your publications after the retirement.
- Convert a whole folder of .pub files to PDFArchive years of publications in one go, subfolders included.
- Opening Publisher files in LibreOffice: what works and what doesn'tWhat LibreOffice gets right with .pub files, and its known problems.