PFX / P12 ⇄ PEM Converter (split certificate, private key and intermediate certificates)

Completely free, with no extra charges. You may freely use the output commercially.

About this tool

This tool extracts the server certificate, intermediate certificates and private key as PEM files from a PFX / P12 (PKCS#12) file, the format used by Windows certificate export, IIS, Azure, Java and similar platforms. It also works the other way: it bundles the PEM certificate and private key you use with Nginx or Apache into a PFX file that Windows and cloud services can import.

It reads both the OpenSSL 3 default format (AES-256 / SHA-256) and the format produced by older Windows versions (3DES / RC2 / SHA-1). It checks that the private key matches the certificate's public key and builds a fullchain.pem with the intermediate certificates in issuing order. All processing happens entirely in your browser (no data is sent).

Extract PEM from PFX / P12

Create PFX / P12 from PEM

No files selected

How to use

  1. PFX to PEM: Choose a PFX / P12 file, enter the password used when it was exported and click "Convert to PEM". The certificate list shows the server certificate that matches the private key, followed by the intermediate and root certificates, with their order and expiry dates.
  2. In Nginx, point ssl_certificate at fullchain.pem and ssl_certificate_key at key.pem. Apache 2.4.8 and later can also use the fullchain for SSLCertificateFile and the key for SSLCertificateKeyFile.
  3. PEM to PFX: Select or paste the server certificate, intermediate certificate and private key files. The order is sorted out automatically. Enter the PFX password twice, choose the format that suits the target system and click "Create and save PFX".

For the full workflow of setting up a PFX exported from Windows on Nginx, and what to do when OpenSSL 3 cannot read an old PFX, see "Using a Windows PFX with Nginx: splitting the certificate, intermediates and private key into PEM".

Notes

  • If the PFX password is wrong, the integrity check (MAC) fails and the conversion stops. A PFX created without a password can be read with the field left empty.
  • key.pem is in PKCS#8 format (BEGIN PRIVATE KEY). For RSA keys, a PKCS#1 key-rsa.pem (BEGIN RSA PRIVATE KEY) is also produced for older software.
  • RSA, ECDSA (P-256 / P-384 / P-521) and Ed25519 keys are supported. Whether the key matches the certificate is determined by comparing public keys with the browser's Web Crypto API. When creating a PFX from PEM, a mismatched pair is refused.
  • Accepted private keys are PKCS#8 (encrypted or not), PKCS#1 RSA keys and SEC1 EC keys. The password-protected legacy OpenSSL format is supported for RSA keys only. A PFX cannot be created from a CSR or from a public-key-only file.
  • The "Compatible" format is meant for older systems and uses weaker encryption than "Standard". Choose "Standard" whenever the target system supports it.
  • Extracted private keys are saved unencrypted. Handle the saved files with care and delete them when no longer needed. The limit is 8 MiB per file.