File Extension File Extension Guide

What is a PFX File?PKCS#12

A technical reference for the .pfx extension, a certificate bundle. What a PFX file is, what it holds, how to import it, and how it compares to PEM and P12. This is a security file, so it needs careful handling.

Certificate Bundle 🔐 Holds a Private Key 🔒 Password Protected 📜 PKCS#12
.PFX

PKCS#12 Certificate

Type:Certificate bundle
Extension:.pfx, .p12
Standard:PKCS#12
Holds:Cert plus private key
Protected:By a password

📖 What is a PFX File?

A PFX file is a single file that bundles a digital certificate together with its private key and any supporting certificates. The name stands for Personal Information Exchange, and it uses the .pfx extension. It follows the PKCS#12 standard, and the whole bundle is locked with a password.

The point of a PFX file is to keep everything needed to prove an identity and set up encryption in one place. Because it carries a private key, which is a secret, the file is always encrypted and protected by a password so the key cannot be read by anyone who lacks it.

You will most often meet a PFX file when installing an SSL certificate on a web server or moving a certificate between machines. It is a binary file, so opening it in a text editor shows nothing readable, and it is meant to be imported by software rather than viewed.

Key Characteristics

  • A certificate bundle, in one file
  • Holds a private key, kept secret
  • Password protected, and encrypted
  • Follows PKCS#12, an open standard

Good to Know

  • Same as .p12, just a different name
  • Common on Windows, and macOS
  • Portable, for moving certificates
  • Not human-readable, a binary file
💡 Why it matters: A certificate and its private key normally live in separate files. A PFX file packs them together with the chain of trust, which makes backing up or moving a complete certificate to another server much simpler.
Three parts, bundled into one protected file 🔑 Private key the secret 📜 Certificate your public cert 🔗 Chain intermediate certs 🔒 file.pfx one encrypted bundle locked with a password combine and encrypt

⚡ Quick Facts

File Extension.pfx, also .p12
Full NamePersonal Information Exchange
CategoryCertificate and key bundle
StandardPKCS#12
FormatBinary, encrypted
ProtectionPassword required
MIME Typeapplication/x-pkcs12
Common OnWindows, macOS servers
Imported WithCertificate Manager, Keychain, OpenSSL
Related Extensions.p12, .pem, .crt, .cer

📦 What a PFX File Contains

A PFX file bundles three kinds of thing, all protected by one password. Together they form the complete package a server needs to prove its identity and encrypt traffic.

Private key

Private Key

The secret key, the most sensitive part, used to set up secure connections. It must be kept protected.

Certificate

The Certificate

The public certificate issued to you, an X.509 certificate holding your public key and confirming your identity to others.

Chain

Chain Certificates

Any intermediate certificates that link yours back to a trusted root, forming the chain of trust.

⚠️ The private key is the sensitive part: Because a PFX file includes the private key, anyone with the file and its password holds the keys to your certificate. That is why it is encrypted and why it should be shared only over secure channels.

🎯 What a PFX File Is Used For

PFX files show up wherever a certificate and its key need to travel together, mostly in web and email security.

SSL/TLS certificatesInstalling an HTTPS certificate on a web server such as Microsoft IIS, where the key and cert are needed together.
Moving certificatesExporting a certificate with its key from one server and importing it on another, or keeping a backup.
Code signingSigning software so users can verify it came from you and has not been tampered with.
Email securitySigning and encrypting email in clients like Outlook, using a certificate held in a PFX file.
Moving a certificate from one server to another Server A export cert + key 🔒 file.pfx password-locked Server B import, back in use bundle password transfer it only over a secure channel, since it holds the private key

📥 How to Import a PFX File

You do not really open a PFX file to read it. Instead you import it into the system or software that will use the certificate. The password set when it was created is needed.

1

On Windows

Double-click the PFX to launch the Certificate Import Wizard, or open Certificate Manager with certmgr.msc and import it there.

2

On a Mac

Open the file with Keychain Access, which adds the certificate and its key to a keychain after you enter the password.

3

On a server

A web server like IIS has an import option in its certificate settings, where you point it at the PFX and supply the password.

💡 The password is required: Importing always asks for the password that was set when the PFX was made. Without it, the file stays encrypted and the certificate cannot be installed, so keep that password safe.

📤 How to Create a PFX File

You make a PFX by exporting a certificate you already hold, together with its private key, into the bundled format. On Windows this is done through the certificate store.

1

Open the export wizard

In Certificate Manager, find your certificate, right-click it, then choose All Tasks and Export to start the Certificate Export Wizard.

2

Include the private key

Choose Yes, export the private key, pick the PKCS#12 format, and tick the option to include all certificates in the path.

3

Set a password

Enter a strong password to protect the file, then save it with a .pfx ending. That password will be needed to import it later.

💡 From the cloud too: Platforms like Azure let you export a managed certificate as a PFX, so you can install the same certificate on servers outside the platform. The export is still password-protected in the same way.

🔄 Converting to PEM

Some software, especially on Linux, expects certificates in PEM format rather than PFX. The usual tool for changing between them is OpenSSL.

OpenSSL is a free command-line toolkit that can read a PFX file, once you supply its password, and write out the certificate and key in PEM form for use by servers like Apache or Nginx. The reverse also works, so a PEM certificate and key can be packaged into a PFX bundle. Because the process handles a private key, run it only on a machine you control and keep the output files protected. If you only need the public certificate to share, you can export just the .cer part, which holds no private key and is safe to hand out.

⚠️ Handle the output with care: Converting a PFX produces the private key in another form. Treat those files as secrets too, store them safely, and remove any copies you no longer need.

⚔️ PFX vs PEM and P12

Certificates come in a few formats that are easy to mix up. Here is how PFX sits next to the ones it is most often compared with.

FormatHolds the KeyEncodingCommon On
PFX yesBinaryWindows, macOS
P12 yesBinaryUnix, Linux
PEM~ optionalTextLinux servers

In short, PFX and P12 are the same PKCS#12 format under two names, both binary and both able to carry a private key. PEM is a text format that may hold a certificate on its own or together with a key, and it is the usual choice on Linux servers.

🛡️ Handling a PFX Safely

⚠️ A PFX file is a secret: It contains your private key, so anyone who has both the file and its password can act as your certificate. Guard it like a password, never post it publicly, and send it only through secure, encrypted channels.

Use a strong password when a PFX is created, since that password is all that protects the private key inside. Store the file somewhere access-controlled, such as a secure server folder or a secrets vault, rather than a shared drive or an email inbox.

Delete copies you no longer need, and if you suspect a PFX file has been exposed, treat the certificate as compromised and have it reissued. Keeping the private key private is the whole point of the format.

🔑 If You Lose the Password

The password on a PFX file is not a lock you can pick. It is part of the encryption that protects the private key, so without it the contents genuinely cannot be read.

There is no back doorThe file is encrypted with the password, so no tool can simply open it without that password.
Check for another copyYou may have the original certificate and key elsewhere, or an unprotected export you can repackage.
Reissue the certificateIf the password is truly gone, request a new certificate from the certificate authority that issued it and replace the old one.

🔀 Related Formats

PFX sits among the certificate formats you compare it with.

.p12The same PKCS#12 format as PFX, just the more common name on Unix and Linux systems.
.pemA text-based certificate format, which may hold a certificate alone or with a key, common on Linux.
.crtA certificate file, often a single public certificate without the private key.
.cerAnother certificate extension, usually holding one certificate in text or binary form.
.keyA private key on its own, separate from the certificate, unlike the bundled PFX.

❓ Frequently Asked Questions

You do not open a PFX file to read it, since it is an encrypted binary file. Instead you import it into the software that will use the certificate. On Windows, double-click it to launch the Certificate Import Wizard, on a Mac open it with Keychain Access, and on a web server use its certificate import option. You will need the password set when the file was made.

A PFX file bundles a digital certificate, its private key and any chain certificates into one file, following the PKCS#12 standard. It uses the .pfx extension and is encrypted, protected by a password. It is mainly used to install or move SSL certificates, since it keeps everything a server needs to prove its identity and encrypt traffic in a single package.

A PFX file holds three things, all protected by one password. The private key is the secret used to set up secure connections, the certificate is your public certificate confirming your identity, and the chain certificates are intermediates linking yours to a trusted root. Bundling them together is what makes a PFX handy for backing up or moving a certificate.

There is no real difference. PFX and P12 are two names for the same PKCS#12 format, a binary file that bundles a certificate with its private key. Microsoft tends to use the .pfx extension while .p12 is more common on Unix and Linux, but tools like OpenSSL handle both the same way. You can usually rename one to the other.

PFX is a binary format that always bundles the certificate with its private key, protected by a password. PEM is a text format, readable as blocks of characters, that may hold just a certificate or a certificate and key together. Windows servers commonly use PFX, while Linux servers like Apache and Nginx usually expect PEM, so conversion between them is common.

Double-click the PFX file to start the Certificate Import Wizard, then follow the prompts and enter the password set when the file was created. You can also open Certificate Manager by running certmgr.msc, then import the file into the right certificate store. On a web server such as IIS, use the import option in its certificate settings instead.

Yes. A PFX file is encrypted, and the password is set when the file is created. That password is required every time you import the file, since it is what decrypts the private key inside. Without it, the file cannot be opened or installed. For that reason, the password should be strong and stored somewhere safe.

Yes. The usual tool is OpenSSL, a free command-line toolkit, which reads the PFX with its password and writes out the certificate and key in PEM format for servers that expect it. The reverse works too, packaging a PEM certificate and key into a PFX. Since the process handles a private key, run it on a machine you control and protect the output.

Only with great care. A PFX file contains your private key, so anyone holding both the file and its password can act as your certificate. Never post one publicly or send it over insecure channels. If you must share it, use an encrypted, trusted method and consider the certificate compromised if the file is ever exposed to the wrong people.

A PFX file is mainly used to install and move SSL and TLS certificates. It bundles a certificate with its private key, so it is ideal for setting up HTTPS on a web server like IIS, backing up a certificate, or moving one between servers. It is also used for code signing and for signing or encrypting email in clients like Outlook.

PFX stands for Personal Information Exchange. It reflects the format's purpose of exchanging personal cryptographic information, meaning a certificate and its private key, between systems in a secure, encrypted file. The format follows the PKCS#12 standard, and the same format is also seen with the .p12 extension, especially on Unix and Linux.

The password is part of the encryption, so if it is truly lost, the file cannot be opened by any tool. The practical answer is to look for another copy of the certificate and key elsewhere, or an unprotected export you can repackage. If nothing is available, request a new certificate from the authority that issued it and replace the old one.

You make a PFX by exporting a certificate you already hold. On Windows, open Certificate Manager, right-click your certificate, then choose All Tasks and Export. In the wizard, select Yes to export the private key, pick the PKCS#12 format, include the certificate path, and set a password. Save it with a .pfx ending. That password is then required whenever the file is imported.

In Azure, a certificate stored in Key Vault or bought as an App Service Certificate can be downloaded in PFX form, letting you install the same certificate on servers outside Azure. The portal offers a download in PFX format, and the file comes password-protected like any other. Note that a free App Service managed certificate is tied to Azure and cannot be exported this way.

Yes. Sometimes you only need the public certificate, for example to give someone so they can trust your server. You can export just the certificate as a .cer file, which holds the public part and no private key, so it is safe to share. The private key stays inside the original PFX, protected by its password, and is never included in a public .cer export.

📝 Summary

A PFX file is a PKCS#12 certificate bundle that holds a certificate, its private key and any chain certificates in one encrypted, password-protected file, using the .pfx extension. It is mainly used to install SSL certificates on web servers and to move or back up certificates between systems. You import it rather than open it, using the Certificate Import Wizard on Windows, Keychain Access on a Mac, or a server's import option, and the password set at creation is always required. PFX and P12 are the same format, while PEM is a text alternative common on Linux. Since a PFX carries a private key, treat it as a secret and share it only through secure channels.