.gpg

How to Open GPG File: Decrypt, Verify or Import It

A GPG file is data protected with GnuPG (OpenPGP): usually an encrypted file, sometimes a signed file or a key. To open an encrypted .gpg you need the right private key or password and a GnuPG program: Kleopatra (Gpg4win) on Windows, GPG Suite on Mac or the gpg command on Linux. The checker below tells you, without any key, what kind of GPG file you have, who can decrypt it, who signed it, and extracts the file when it's only signed or compressed.

Category: Encrypted or signed data Standard: OpenPGP (RFC 4880, RFC 9580) Opens with: Kleopatra, GPG Suite, gpg

Choose what you need

Open GPG File Online: See What's Inside (Free, No Key Needed)

Drop a .gpg file below, or paste a PGP block. The checker reads the OpenPGP packets and tells you what the file is: encrypted for which key IDs or with a password, signed by which key and when, or a public or private key with its owner, fingerprint and expiry. When the file is only signed or compressed, it extracts the original file for you.

Good to know: it can't decrypt anything (that needs your private key or password in GnuPG), but it tells you exactly which key or password you need.

πŸ”’ Nothing is uploaded β€” your file and keys never leave this device
Or paste a PGP block (key, message or signature)

What is a GPG file?

A GPG file is a file processed with GnuPG (GNU Privacy Guard), the free implementation of the OpenPGP standard. GnuPG adds the .gpg extension when it encrypts or signs a file in binary form, so report.pdf.gpg is report.pdf after encryption. The same extension is used for exported keys and for GnuPG's own keyring files. The content is made of OpenPGP "packets", and the first ones reveal what the file is without decrypting anything:

Kind of .gpgWhat you need to open it
Encrypted to a public keyThe matching private key (and its passphrase) on your computer
Encrypted with a password (gpg -c)The password, nothing else
Signed (and compressed) but not encryptedNothing secret: the file inside can be extracted; the signer's public key verifies it
Public or private key exportImport it into GnuPG / Kleopatra
pubring.gpg, trustdb.gpgGnuPG's own databases; don't open them directly
Full nameGNU Privacy Guard (OpenPGP) data
Same format as.pgp; .asc is the text (ASCII-armored) version
Typical encryptionAES-256 with RSA, Curve25519 or other public keys
Related.asc, .sig, .pgp, .kbx

How to open a GPG file: quick answer

SystemFree programHow to decrypt
Windows 11 / 10Gpg4win (Kleopatra)Double-click the .gpg or File > Decrypt/Verify
MacGPG SuiteRight-click > Services > OpenPGP: Decrypt File
Linuxgpg (preinstalled on most systems)gpg -o file -d file.gpg
AndroidOpenKeychainShare the file to OpenKeychain > Decrypt
Any deviceThe checker on this pageShows what it is; extracts signed files

No website or tool can open an encrypted GPG file without the private key or password. That's the point of the encryption, so be wary of services that claim otherwise.

Open GPG files on Windows with Kleopatra

  1. Download Gpg4win from gpg4win.org and install it with Kleopatra selected (the default).
  2. If the file is encrypted to your key, make sure your private key is in Kleopatra: File > Import your key backup if needed.
  3. Double-click the .gpg file, or open Kleopatra and choose Decrypt/Verify, then select the file.
  4. Enter your key's passphrase (or the file's password when it was encrypted with one) and click Save to write the decrypted file next to the original.
Illustration: Kleopatra after decrypting a .gpg file.

Open GPG files on Mac, Linux and phones

Mac

Install GPG Suite from gpgtools.org. It adds GPG Keychain for your keys and Finder services: right-click the .gpg file > Services > OpenPGP: Decrypt File. You can also use Terminal with the same commands as Linux.

Linux and command line

Illustration: the three gpg commands you need most.

Use -o to choose the output file; without it, gpg -d prints the content in the terminal.

Android and iPhone

On Android, OpenKeychain (free, open source) imports keys and decrypts .gpg files shared to it. On iPhone, use an OpenPGP app from the App Store that can import your private key. Only put a private key on a phone you trust.

Keys and keyrings (.gpg key files)

If the checker says your file is a public key, import it so you can encrypt to that person or verify their signatures: gpg --import key.gpg, or Kleopatra's File > Import, or double-click it with GPG Suite. To look at a key without importing it, run gpg --show-keys key.gpg; then compare the fingerprint with one the owner gave you through another channel.

If it's a private key, it's your identity: keep it offline and never send it to anyone. Files named pubring.gpg, secring.gpg or trustdb.gpg are GnuPG's internal databases from the .gnupg folder; copy the whole folder when moving to a new computer, or better, export and import keys.

GPG problems and fixes

"decryption failed: No secret key"

The file was encrypted for a key that isn't on this computer. The checker shows the key ID it was encrypted for; compare it with gpg --list-secret-keys --keyid-format long. Import your private key backup, or ask the sender to encrypt it to your current public key.

"Bad session key" or "decryption failed: Bad passphrase"

The password is wrong (for password-encrypted files) or you typed the wrong key passphrase. Check the keyboard layout and Caps Lock.

"unexpected end of file" or "invalid packet"

The file is incomplete or damaged; the checker reports when it ends mid-packet. Get it again, and send binary files as attachments rather than pasting them into a message.

"WARNING: message was not integrity protected"

The file uses an old encryption mode. Recent GnuPG refuses it by default; ask the sender to encrypt it again.

The file has no .gpg extension

Encrypted files are sometimes named .pgp or have no extension. If the checker recognizes it as OpenPGP, the same programs open it.

Sources and technical references

Frequently asked questions

How do I open a GPG file?

If it's encrypted, open it with a GnuPG program and the right key or password: Kleopatra (Gpg4win) on Windows, GPG Suite on Mac, or gpg -o file -d file.gpg on Linux. The checker on this page shows, without any key, whether the file is encrypted, signed or a key.

Can I open a GPG file without the key?

Not if it's encrypted: only the matching private key or the password can decrypt it. If the file is only signed or compressed, the checker on this page extracts the original file without any key.

How do I decrypt a GPG file on Windows?

Install Gpg4win, make sure your private key is in Kleopatra, then double-click the .gpg file or choose Decrypt/Verify. Enter your passphrase and save the decrypted file.

What does 'No secret key' mean?

The file was encrypted for a key that isn't on this computer. The checker shows the key ID it needs; import your private key backup or ask the sender to encrypt it to your current public key.

What's the difference between GPG, PGP and ASC files?

They're all OpenPGP data. .gpg and .pgp are binary; .asc is the same data as readable ASCII text (armor), which is easier to paste into emails and web pages. The same programs open all three.

Is it safe to open a GPG file?

Inspecting it is safe: OpenPGP files can't run code. After decrypting, treat the file inside like any other download. Never share a file the checker identifies as a private key.

How do I open a GPG file on Mac?

Install GPG Suite, then right-click the file and choose Services > OpenPGP: Decrypt File, or use Terminal with gpg -o file -d file.gpg. Your private key must be in GPG Keychain.

What are pubring.gpg and trustdb.gpg?

They're GnuPG's own databases: your public keyring and the trust settings for keys. Don't open or edit them; use gpg --list-keys or Kleopatra to view keys, and export and import keys when changing computers.

Last updated .