Convert PEM to DER in one step
PEM and DER hold exactly the same data. DER is the raw binary encoding, and PEM is that binary wrapped in Base64 with BEGIN and END lines so it survives email and copy-and-paste. This pem to der converter strips the wrapper and gives you the binary bytes, which some Java keystores, Windows tools, embedded devices and APIs require.
Example
Converting the sample EC public key with the Hex dump view gives 91 bytes:
00000000 30 59 30 13 06 07 2a 86 48 ce 3d 02 01 06 08 2a |0Y0...*.H.=....*|
00000010 86 48 ce 3d 03 01 07 03 42 00 04 26 ba 1c 38 c5 |.H.=....B..&..8.|
00000020 41 de cd 2c 44 3f db e5 e8 51 62 04 3f 35 03 6b |A..,D?...Qb.?5.k|
…
The status line reads "PUBLIC KEY: 91 bytes of DER". The leading 30 is the ASN.1 SEQUENCE tag, which almost every certificate and key starts with.
Output options
- Hex: one continuous string, or bytes separated by spaces or colons. Colon-separated hex matches the style of OpenSSL fingerprints.
- Base64 (single line): the PEM body without line breaks or headers. This is the form expected by
x5centries in a JWK and by many JSON APIs. - Hex dump: offsets, 16 bytes per row and an ASCII column, like
xxdorhexdump -C.
The download uses a name based on the PEM type: certificate.der, request.der, public.der, or key.der for private keys.
Good to know
- Only the first PEM block is converted. When you paste a chain, the status line says "first of N blocks". Convert the others one at a time.
- A DER file cannot hold several certificates the way a PEM file can. For a chain in one binary file, use PKCS#7 (.p7b).
- Converting does not decrypt anything. An
ENCRYPTED PRIVATE KEYstays encrypted in DER form. - The command-line equivalent is
openssl x509 -in cert.pem -outform der -out cert.derfor certificates, oropenssl pkey -outform derfor keys.
To go the other way, use the DER to PEM converter. To see what the bytes mean, paste the same PEM into the ASN.1 decoder. For plain Base64 work unrelated to keys, try Base64 decode.
Privacy
The conversion runs in your browser. Keys and certificates are never uploaded, and the .der download is created locally.