PFX to PEM Converter

How to Extract SSL Certificates from a PFX File: A Complete Guide

In today’s digital world, securing your website with an SSL/TLS certificate is essential. Whether you’re running an e-commerce platform, SaaS product, or personal blog, SSL certificates encrypt data in transit, protect sensitive user information, and build trust with visitors.

Many SSL certificates are distributed as PFX (Personal Information Exchange) files, also known as PKCS#12. These files bundle the private key, public certificate, and often the CA certificate chain into a single, encrypted file. While convenient for backup and transport, PFX files are not always compatible with all servers and platforms.

If you need to extract SSL certificates from a PFX file for server compatibility, migration, or manual SSL installation, this guide will walk you through the process step by step using OpenSSL. Whether you’re a system administrator, web developer, or security professional, the instructions below are designed to be clear and easy to follow.

Why You Need to Extract SSL Certificates from a PFX File

A PFX file (PKCS#12) is commonly used to import or export SSL certificates between systems. However, most web servers and services require the certificate components in separate files, typically in PEM or CRT format.

Common reasons to extract certificates from a PFX file include:

  • SSL/TLS configuration on a new server – Migrating certificates to Apache, Nginx, load balancers, or cloud platforms.
  • Certificate management – Separating the private key and public certificate for installation across different services.
  • Backup and archiving – Storing certificates in standard formats for disaster recovery.

What You’ll Need to Extract SSL Certificates from a PFX File

Before you begin, make sure you have the following:

  • Access to the PFX file and its password, since PFX files are encrypted.
  • OpenSSL, a powerful and widely used open-source cryptography tool.

How to Extract SSL Certificates from a PFX File: Step-by-Step

Step 1: Install OpenSSL (If You Don’t Have It Yet)

OpenSSL is required to extract certificates from a PFX file. Install it based on your operating system:

  • Windows: Download and install OpenSSL from The official OpenSSL distribution . Make sure OpenSSL is added to your system PATH.
  • macOS: Modern macOS versions ship with LibreSSL, not OpenSSL. The recommended approach is installing OpenSSL via Homebrew: brew install openssl
  • Linux: OpenSSL is usually pre-installed. If not, install it using your package manager: sudo apt install openssl

Step 2: Extract the Private Key

The private key is critical for SSL/TLS communication and must be handled securely.

openssl pkcs12 -in yourfile.pfx -nocerts -out private.key

Replace yourfile.pfx with your actual file name. You’ll be prompted for the PFX password, then asked to set a new passphrase to encrypt the private key.

⚠️ Security tip: Some servers require an unencrypted private key. Only remove encryption if absolutely necessary and store the file securely.

Step 3: Extract the Public Certificate

The public SSL certificate is used by servers to establish secure connections and identify your website.

openssl pkcs12 -in yourfile.pfx -clcerts -nokeys -out certificate.crt

Step 4: Extract the CA Certificates (If Needed)

If your PFX file includes intermediate or root CA certificates, extract them to ensure proper certificate chain validation.

openssl pkcs12 -in yourfile.pfx -cacerts -nokeys -out ca-certificate.crt

Step 5: Combine Certificates into a PEM File (Optional)

Some servers require a single PEM file containing the private key, certificate, and CA chain.

cat private.key certificate.crt ca-certificate.crt > full-cert.pem

This command works on Linux and macOS. Windows users may need Git Bash, WSL, or PowerShell equivalents.

Common Issues You Might Encounter

  • Incorrect password: Without the correct PFX password, extraction is not possible.
  • OpenSSL isn’t found: Ensure OpenSSL is installed and available in your system PATH.
  • File permissions: Verify read/write permissions for input and output files.

Need a Simpler Way?

If working with OpenSSL commands feels complex, our online tool makes the process effortless. Upload your PFX file and convert it to PEM format securely—no command line required.

Try it now – Convert in seconds!