Why convert PEM to DER?
Some platforms and tools only accept binary DER files. Java's keytool, older Windows APIs, and certain hardware security modules expect DER. If software rejects your .pem, this conversion is usually the fix.
How to convert PEM to DER
OpenSSL FREE
Run openssl x509 -in cert.pem -outform der -out cert.der for a certificate, or openssl pkey -in key.pem -outform der -out key.der for a private key. OpenSSL is FREE and runs on Windows, macOS, and Linux.
certutil FREE
Open Command Prompt and run certutil -decode cert.pem cert.der to strip the Base64 headers and produce the binary DER file; certutil is built into every Windows installation.
About these formats
A PEM file is a text container for cryptographic data - most often an SSL/TLS certificate, a private key, or both. Open it in any text editor to see what the BEGIN line says, then use…
Open .PEM details →A .DER file is associated with DER encoded internet security certificate, a web file.
Open .DER details →Quality & what to watch
- PEM and DER hold the same ASN.1 cryptographic data - DER is the binary encoding of exactly what PEM stores as Base64; no information is added or removed.
- A multi-block
.pemcontaining a certificate chain cannot be converted to a single.der- DER holds one object per file; split the blocks first. - A DER-encoded certificate is also commonly saved as
.ceror.crt- the content is identical regardless of extension.
Frequently asked questions
Is there any information loss when converting PEM to DER?
Can I convert a private key from PEM to DER?
openssl pkey -in key.pem -outform der -out key.der - but a DER key has no password protection, so keep it as secure as the original PEM.How do I verify the DER output is correct?
openssl x509 -in cert.der -inform der -text -noout; if it prints certificate details, the conversion succeeded.How do I convert DER back to PEM?
openssl x509 -in cert.der -inform der -outform pem -out cert.pem.