The same SSL certificate ends up as PEM on some servers and DER on others. Here's what actually differs between the two.
PEM โ the text-based format
Base64-encoded data wrapped between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----. It's the standard for nginx, Apache, and most Linux-based servers, and being plain text makes it easy to paste into an email or config file.
DER โ the binary format
The raw binary data you get from decoding the Base64 inside a PEM file. It's not human-readable but is more compact, and Java-based applications (via keytool), some Windows environments, and certain embedded devices often require it.
When you need to convert
Conversion comes up when a CA hands you a PEM certificate but you need to import it into a Java app server (like Tomcat) via keytool, or the reverse โ a DER certificate that needs to go into an nginx config. The two only differ in encoding; the underlying content is identical.