PFX PEM Converter
Convert a PFX or P12 file to PEM certificates and a private key, or bundle a PEM certificate, key and chain into a password-protected PFX file. Runs in your browser.
Input
Output
Readme
What are PFX and PEM files?
A PFX file (also called P12 or PKCS#12) bundles a certificate, its private key and usually the certificate authority's certificates into one password-protected file. Windows, IIS, Azure and many Java servers use it.
PEM files are plain text, with each certificate or key between lines like -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----. Linux servers such as nginx, Apache, HAProxy and Caddy use them.
This tool converts in both directions.
PFX to PEM
- Choose your
.pfxor.p12file and enter its password. - The tool shows who the certificate was issued to, who issued it and the dates it's valid.
- Copy or download the certificate, the CA certificates that came with it and the private key.
For nginx, put the certificate and then the CA certificates into one file for ssl_certificate, and the private key into another for ssl_certificate_key. The private key comes out without a password, so keep it where only your server can read it.
PEM to PFX
- Paste your certificate, your private key and, if you have them, the CA certificates. It doesn't matter which field the certificate and the CA certificates go in: the tool finds the certificate that belongs to the key.
- Choose a password for the PFX file and type it twice.
- Pick the encryption and click Download PFX file.
The checklist shows what's ready: the certificate, the key, whether the key belongs to the certificate and the password. The private key can be in PKCS#8 (BEGIN PRIVATE KEY), PKCS#1 (BEGIN RSA PRIVATE KEY) or EC (BEGIN EC PRIVATE KEY) format. If it's encrypted, a field for its passphrase appears.
Use plain English letters, digits, spaces and common symbols in the PFX password. Programs turn other characters into keys in different ways, so a file with such a password might not open everywhere.
Which encryption should I pick?
- AES-256 is what OpenSSL 3 and current versions of Windows and macOS write. Pick it unless something asks for Triple DES.
- Triple DES is the older format that every system can read, including Windows Server 2016 and earlier and services such as Azure App Service that ask for it. It works with RSA keys only.
How it works
PFX files are read with the node-forge library, which handles both the modern AES and the older Triple DES and RC2 formats. AES-256 files are written with PKI.js in the same format as OpenSSL 3, and Triple DES files with node-forge. Your files, passwords and keys stay in your browser and are never uploaded.
Features
- PFX or P12 to PEM: certificate, CA certificates and private key
- PEM to password-protected PFX with AES-256 or Triple DES
- RSA and ECDSA certificates and keys
- Checks that the private key belongs to the certificate
- Reads PKCS#8, PKCS#1 and EC keys, encrypted ones too
- Runs in your browser