SSL Converter
Paste or drop a certificate, chain, key, P7B or PFX and get it back as PEM, DER, P7B or PFX. Nothing leaves your browser.
Also: PFX to PEM, PEM to PFX, CRT to PEM, P7B to PEM
- 0
- Certificates
- 0
- Keys
- 0
- Errors
On this page
About SSL Converter
Updated
What is an SSL Converter?
An SSL converter changes a certificate file from one format to another. Your CA sends PEM, your Windows server wants a PFX, Java wants something else. This one reads all the common formats: PEM, CRT, CER, DER, P7B and PFX (also called P12). It also checks what the other converters skip. Does the key fit the certificate? Is the chain in the right order? Where exactly is a broken line?
It converts in your browser, so your private key never leaves your computer. Most SSL converters upload the file and the password to a server. Open the Network tab of your browser (F12) and convert a file here: no request goes out.
How to use this tool
- Paste the certificate, the chain or a P7B as text, or drop a .pem, .crt, .cer, .der, .p7b, .pfx or .p12 file. A PFX shows as Base64 text: that is fine.
- A private key can go in the same box or in the Private key tab. The tool finds which key belongs to which certificate.
- You can add several files. Pick them all at once in File, or drop them together. A file you add later goes below the text that is there: it does not replace it. A .key file goes to the Private key tab by itself. Clear empties the editor.
- Pick the format in To. For a PFX, type the password in the Password field. On a wide screen, To and Password are next to Convert. On a smaller screen, they are under Options, and on a phone under More.
- Copy the text, or press Download to save the file. A PFX or DER file downloads as a real binary file, ready to import.
For PEM, the Result has one view per file: Full chain (fullchain.pem for nginx), Certificate, Chain (the CA bundle), Key and All in one file. Each view downloads with its own file name.
The same tool, set up for other jobs: PFX to PEM, PEM to PFX, CRT to PEM, P7B to PEM.
SSL certificate formats
| Format | Extensions | What is inside | Used by |
|---|---|---|---|
| PEM | .pem .crt .cer .key | Base64 text between BEGIN and END lines. Certificates, chain and key, in one file or several. | nginx, Apache, HAProxy, Node.js, Linux, Let's Encrypt |
| DER | .der .cer .crt | One certificate in binary. The same data as PEM, without the Base64. | Java, Windows, Android, some routers |
| P7B | .p7b .p7c | PKCS #7: a list of certificates, often the whole chain. Never a private key. | Windows, Tomcat, Java keytool, many CAs |
| PFX | .pfx .p12 | PKCS #12: certificates and the private key in one binary file, locked with a password. | IIS, Windows, Azure, Exchange, macOS Keychain |
The file name does not always tell the format. A .crt file can be PEM text or binary DER. Open it in a text editor: if it starts with -----BEGIN, it is PEM. This tool finds the format from the content, so the name does not matter.
Modern and Legacy PFX
A PFX can be locked in two ways. Modern uses AES-256 and a SHA-256 check, as OpenSSL 3 does. Windows 11, Windows Server 2019 and newer, and OpenSSL 3 read it. Legacy uses 3DES and SHA-1. Windows Server 2016 and older need Legacy (Microsoft). macOS 14 and older need it to import into the Keychain, and Microsoft's guide for Azure App Service uses 3DES too. Modern is the default. Pick Legacy only when one of these systems must open the file.
Common errors when you convert certificates
The wrong password, or a PFX that needs one
A PFX file is locked with a password. Without the right one, nothing inside can be read. The tool says This PFX needs its password or The password does not open this PFX, and keeps the file in the editor. Press Type the password on the error card, or type it in the Password field. A PFX from Windows with no password often has an empty one: leave the field empty.
A PFX that uses too many rounds
A PFX says how many times the password goes through the hash. These are the rounds. OpenSSL uses 2,048 by default. Each round makes the file slower to open. .NET, which many Windows programs use, refuses a PFX when its rounds add up to more than 600,000 (KB5025823). This page stops when one part of the file uses more than 600,000, and says how many rounds the file uses. Make the file again with a normal count:
openssl pkcs12 -in cert.pfx -nodes -out all.pem
openssl pkcs12 -export -in all.pem -out new.pfx -iter 2048Delete all.pem when you are done: it holds the key without a password. For an encrypted key with too many rounds, run openssl pkcs8 -topk8 -in key.pem -out new.key -iter 2048.
The key does not belong to the certificate
A PFX must hold the private key of its certificate. A key from an old CSR, or from another server, does not work with the certificate, and the server cannot use the PFX. The tool compares the public part of the key with the certificate. When they differ, it stops and shows which key and which certificate:
-----BEGIN CERTIFICATE-----
(shop.example.com, made from CSR 1)
-----END CERTIFICATE-----
-----BEGIN PRIVATE KEY-----
(the key of CSR 2)
-----END PRIVATE KEY-----Find the key you made with the CSR for this certificate. On the server, it is often in the same folder as the old certificate. With openssl, the two lines below print the same hash when the key fits:
openssl x509 -in cert.pem -noout -pubkey | openssl sha256
openssl pkey -in privkey.pem -pubout | openssl sha256No private key
A PFX for IIS or Azure needs the private key. On PEM to PFX, certificates without a key give the error No private key. Paste the key you made with your CSR in the Private key tab. If the key is lost, ask the CA to issue the certificate again with a new CSR.
On this page, a PFX with certificates only is allowed, for a trust store. The result then says no key, with a warning.
A PFX with no password
When the Password field is empty, the tool makes a PFX with an empty password and shows a warning. Anyone with the file can then read the private key. Type a password before you download a file that you store or send.
A broken line in the PEM text
Copy and paste can change a character, drop a dash or cut the END line. The tool marks the exact line and column, and says what it found. When the tool can repair the text, the error card has a Fix PEM button. It puts back the five dashes and the END line, changes \n written as text to real line breaks, and wraps the Base64 at 64 characters. Fix PEM cannot repair a wrong character in the Base64. For that, copy the certificate again from the mail or portal of your CA.
----BEGIN CERTIFICATE----
MIIBszCCAVmgAwIBAgIUQ2n3...
...7wKqA0Z5Q==-----BEGIN CERTIFICATE-----
MIIBszCCAVmgAwIBAgIUQ2n3...
...7wKqA0Z5Q==
-----END CERTIFICATE-----A P7B file has no private key
P7B holds certificates only. To make a PFX from a P7B, you also need the private key from when you made the CSR. Paste the P7B, add the key in the Private key tab, and set To to PFX. If the key is lost, ask the CA to issue the certificate again with a new CSR.
The chain is in the wrong order
A server must send its own certificate first, then each issuer up to the root. A file with the root first works on some servers and fails on some clients. The tool puts the certificates in server order and says so in Notes. To check a chain in more detail, use the Certificate Decoder.
Convert with openssl
Each conversion this page does, as an openssl command. Run them where the files are, on your own computer.
openssl pkcs12 -in cert.pfx -nokeys -out fullchain.pem
openssl pkcs12 -in cert.pfx -nocerts -nodes -out privkey.pemThe -nodes option writes the key without a password. It works in OpenSSL 1.1.1, OpenSSL 3 and LibreSSL. OpenSSL 3 also has the new name -noenc, which older versions do not know.
On OpenSSL 3, an old PFX made with 40-bit RC2 fails with unsupported and RC2-40-CBC. Add -legacy to the command. A PFX made with 3DES opens without it. This tool opens both without a flag.
openssl pkcs12 -export -out cert.pfx -inkey privkey.pem -in cert.pem -certfile chain.pemopenssl pkcs12 -export -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -macalg sha1 -out cert.pfx -inkey privkey.pem -in cert.pem -certfile chain.pemOpenSSL 3 makes a PFX with AES-256. The second command makes it with 3DES and a SHA-1 check, as the Legacy type on this page does. Use it for Windows Server 2016 and older. Microsoft's guide for Azure App Service gives the same options.
openssl x509 -inform DER -in cert.crt -out cert.pem
openssl x509 -in cert.pem -outform DER -out cert.deropenssl pkcs7 -print_certs -in cert.p7b -out fullchain.pem
openssl crl2pkcs7 -nocrl -certfile fullchain.pem -out cert.p7bJava keystores (JKS)
This tool does not read or write a Java keystore (JKS). Java 9 and newer use PKCS #12 as the default keystore, so a PFX file from this page works in Java as it is. To move between JKS and PFX, use keytool, which comes with Java:
keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -deststoretype PKCS12
keytool -importkeystore -srckeystore keystore.p12 -srcstoretype PKCS12 -destkeystore keystore.jks -deststoretype JKSTo read the fields of a certificate, such as the names, dates and fingerprints, paste it into the Certificate Decoder. For a CSR, use the CSR Decoder. The PFX format is in RFC 7292.
Other certificate resources
- RFC 7292: PKCS #12The PFX format: safe bags, the key bag, password-based encryption and the MAC.
- RFC 9579: PBMAC1 in PKCS #12The newer MAC for PFX files, based on PBKDF2. OpenSSL 3.4 can make it, and this tool reads it.
- RFC 2315: PKCS #7The SignedData structure that a P7B file uses to carry a list of certificates.
- RFC 7468: Textual Encodings (PEM)The BEGIN and END lines and the labels: CERTIFICATE, PRIVATE KEY, PKCS7.
- openssl pkcs12 manualThe command that makes and opens PFX files, with -legacy, -nodes, -noenc and -certpbe.
- openssl pkcs7 manualThe command that prints the certificates in a P7B file with -print_certs.
- Can't import an AES256-SHA256 PFX (Microsoft)Which Windows versions cannot import a PFX made with AES-256, and that 3DES works there.
- KB5025823: .NET and PFX rounds (Microsoft)Why .NET refuses a PFX with more than 600,000 password rounds.
- Import-PfxCertificate (Microsoft)How Windows imports a PFX into a certificate store from PowerShell.
- node-forgeThe JavaScript library this tool uses to open and seal PFX files and encrypted keys.
SSL Converter FAQ
How do I convert an SSL certificate to another format?
Paste the certificate, or drop the file, in the editor. Pick the format in To: PEM, DER, P7B or PFX. The tool converts as you type. Press Download to save the file. For a PFX, type the password in the Password field.
What is the difference between PEM, CRT, DER, P7B and PFX?
PEM is text: Base64 between BEGIN and END lines. DER is the same data in binary. CRT and CER are names for a certificate file, and the content can be PEM or DER. P7B (PKCS #7) holds a list of certificates and never a key. PFX or P12 (PKCS #12) holds the certificates and the private key in one file, locked with a password.
Which format does my server need?
nginx, Apache, HAProxy and most Linux software want PEM. IIS, Exchange and Azure App Service want a PFX. Java and Tomcat take a PFX (PKCS #12) or a P7B for the chain. On Windows, a double-click opens a .cer, .crt, .der, .p7b or .pfx file. Windows does not open a .pem file as a certificate, so rename it to .crt first.
Is it safe to convert a private key online?
Yes. The tool converts in your browser, in JavaScript on this page. Your files, your private key and the password are never uploaded, stored or logged, and nothing goes in the URL. The password is not saved, not even in your browser. You can check this yourself. Open the developer tools (F12), go to the Network tab and convert a file: no request goes out. Or load the page, turn off Wi-Fi and convert a PFX. For a key that guards a large site, the safest place is still your own computer: the openssl commands are on this page.
Why does my PFX not import on Windows Server 2016?
OpenSSL 3 and new tools make a PFX with AES-256. Windows Server 2016 and older cannot import it, and say that the password is incorrect, even when it is right. Make the PFX again with PFX type set to Legacy. It uses 3DES and SHA-1, which old and new Windows versions read.
Can I convert a JKS keystore here?
No. Use keytool, which comes with Java: keytool -importkeystore -srckeystore keystore. turns a JKS into a PFX. Java 9 and newer read a PFX as a keystore, so a PFX from this tool works in Java as it is.
How do I convert a certificate with openssl?
Each conversion has its own command. PFX to PEM is openssl pkcs12 -in cert.. PEM to PFX is openssl pkcs12 -export -inkey privkey.. DER to PEM is openssl x509 -inform DER -in cert.. P7B to PEM is openssl pkcs7 -print_certs -in cert.. The full list is on this page.