PEM to PFX Converter: Command and Free Tool
openssl pkcs12 -export -out certificate.pfx -inkey private.key -in certificate.crt -certfile chain.crt and set an export password. You can also use the free SSL Converter.PEM vs PFX
| Format | Contents | Typical use |
|---|---|---|
| PEM (.pem, .crt, .key) | Base64 text, usually separate files for certificate, key and chain | Nginx, Apache, most Linux software |
| PFX / P12 (.pfx, .p12) | Binary PKCS#12 bundle with certificate, key and chain, password protected | IIS, Windows, Azure, some Java tools |
PEM to PFX converter: the OpenSSL command
openssl pkcs12 -export \
-out certificate.pfx \
-inkey private.key \
-in certificate.crt \
-certfile chain.crt
OpenSSL asks for an export password. Choose a strong one and store it safely. You need it when importing the file.
-inis the server certificate only.-certfileholds the intermediate certificates. Leave out the root.- If your chain is in one file with the leaf, use that file with
-inand skip-certfileonly if the key matches the first certificate.
Check before you convert
A PFX is built from a certificate and a private key that must match. Verify them:
openssl x509 -in certificate.crt -noout -pubkey | openssl sha256
openssl pkey -in private.key -pubout | openssl sha256
Both hashes must be the same. If not, see how to fix a certificate mismatch.
Convert PFX back to PEM
openssl pkcs12 -in certificate.pfx -nodes -out all.pem
This writes the key unencrypted into all.pem, so protect or delete the file afterwards. Newer OpenSSL 3 builds may need -legacy for old PFX files made with weak algorithms.
PEM to PFX converter: importing into IIS
- Open IIS Manager, select the server, then Server Certificates.
- Choose Import and select the PFX, enter the password.
- Bind it to the HTTPS binding of your site.
Common errors
| Error | Cause |
|---|---|
| No certificate matches private key | Wrong key for this certificate |
| unable to load private key | Key is encrypted or not in PEM format |
| Import fails on Windows | Wrong password or unsupported encryption |
| Chain shows as incomplete | Intermediates were not included |
After installing, check the chain with the SSL Checker. Need a certificate to convert? Generate one free at TryFreeSSL.com.
Related reading: the full PEM to PFX guide and the CRT to PEM converter.
Frequently Asked Questions
Is it safe to upload my private key to an online converter?
Prefer local OpenSSL for production keys. Use online tools only for test keys, or when you are comfortable with the privacy terms.
What is the difference between PFX and P12?
They are the same PKCS#12 format with different file extensions.
Do I need a password?
Windows requires one for import in most cases. Use a strong one.
Can I include the root certificate?
You can, but it is not needed. Clients already hold trusted roots.
Can the browser converter handle my production key?
It can, but do not paste a production private key into any website. Run OpenSSL locally for those.
Should the PFX include the intermediate certificates?
Yes. Export the leaf certificate together with the intermediates your CA provides. A PFX that holds only the leaf leaves some clients unable to build the chain, and Windows will not show the full path. Add the root only when a device you target cannot find it on its own.
Why does Windows ask for the password again when I import the file?
PKCS#12 is an encrypted container, so the password you set during export is needed again at import. If you have lost it, export a new PFX from the PEM files rather than trying to recover the old one. Keep the password out of the same folder as the file.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.