PFX to PEM Converter for Apache and Nginx
This PFX to PEM converter opens a .pfx (PKCS#12) file with its passphrase and extracts every certificate and the private key it contains into separate PEM files, ready for Apache, Nginx and most Linux tooling. The conversion happens entirely in your browser, so your PFX contents never leave your device. Works with both RSA and ECDSA keys.
Processed entirely in your browser
Your files never leave your browser. The page sends only a usage counter signal containing the processing time — never any file content.
Verify this yourself
You don't have to take our word for it — check it yourself in 3 steps:
- Open your browser DevTools and select the Network tab
- Leave the filter on All — do not filter by Fetch/XHR
- Run the conversion and look at the request list
The usage counter is sent with sendBeacon, so it appears under ping (Other) and NOT under Fetch/XHR — that is why you should not filter. You will see a request to /track carrying the processing time. No request carries your file content or passphrase.
Leave empty if the file has no passphrase
Equivalent openssl command
If you would rather run it on your own machine, this command produces the equivalent result.
openssl pkcs12 -in certificate.pfx -out certificate.pem -nodesHow It Works
This tool opens your PFX file entirely inside your browser — the file, its passphrase and everything extracted from it never leave your device. Upload or select your .pfx (or .p12) file, enter the passphrase that protects it (leaving it blank is valid if the PFX has none), and the converter unpacks every certificate and the private key it finds.
You get two downloads: certificate.pem, containing every certificate in the file in its original order (the leaf plus any intermediates — nothing is guessed or dropped), and private.key, the private key re-wrapped as PEM. If the PFX genuinely has no private key inside (some CAs hand out certificate-only bundles), the tool still gives you the certificate file and tells you plainly that no key was found, instead of failing the whole conversion.
All processing happens locally on your device using the open-source node-forge library — the browser's built-in Web Crypto API cannot parse PKCS#12 files, which is why a library is required. This direction works with both RSA and ECDSA keys, unlike the PFX-building tools on this site, which are RSA-only today.
Common Use Cases
- IIS to Apache/Nginx Migration: Move a certificate issued for a Windows server onto a Linux web server
- Certificate Backup Inspection: Read the certificate and key out of a .pfx backup without special tooling installed
- Automation and Config Management: Get separate PEM files that most Linux tools (Apache, Nginx, HAProxy, Ansible) expect, instead of a single PKCS#12 blob
- Recovering the Chain: Extract every intermediate certificate bundled inside a PFX for reuse elsewhere
- Auditing a Received PFX: Check exactly what a partner or CA packaged into a .pfx before deploying it
Protect your website with BKNS SSL — from 199,000đ/year, free installation
Technical Background
PFX (PKCS#12) is a single binary file that carries a certificate, its private key, and optionally an intermediate chain together, encrypted under one passphrase — the format IIS and Windows Server expect. PEM is the opposite approach: a text format, Base64 wrapped between -----BEGIN----- and -----END----- lines, with each piece normally kept in its own file — what Apache, Nginx and most Linux tooling expect.
Opening a PFX means decrypting its SafeContents bags with your passphrase and re-serializing whatever is inside as PEM, without discarding or reordering anything: every certificate bag becomes a CERTIFICATE block in certificate.pem, in the order the PFX stored them. The private key gets a PEM label chosen by its actual algorithm — RSA PRIVATE KEY (PKCS#1) for RSA keys, the classic label most legacy tooling expects, or PRIVATE KEY (PKCS#8) for ECDSA and other algorithms the underlying library does not fully parse into its own object model but can still re-encode losslessly.
All of this runs in your browser using the open-source node-forge library, because the browser's built-in Web Crypto API cannot parse PKCS#12 structures at all. A wrong passphrase is detected explicitly (PFX files carry an integrity MAC over the whole structure) rather than surfacing a raw parser error.