About this tool
PEM is the text wrapper used for almost everything in TLS and SSH: certificates, certificate requests, public keys, private keys, parameters and chains. Inside each -----BEGIN …----- block is Base64-encoded DER, a binary ASN.1 structure. This decoder tells you what each block is, summarises it, and shows its complete ASN.1 tree with object identifiers translated to names.
Decoding runs entirely in your browser. Even so, avoid pasting private keys into websites; use the Private Key Inspector only with keys you can afford to rotate.
Common PEM types
| Header | Contains |
|---|---|
CERTIFICATE | An X.509 certificate (.crt, .cer, .pem) |
CERTIFICATE REQUEST | A CSR (.csr) to send to a certificate authority |
PUBLIC KEY | Any public key, SubjectPublicKeyInfo format |
PRIVATE KEY | Any private key, PKCS#8 format |
ENCRYPTED PRIVATE KEY | A passphrase-protected PKCS#8 private key |
RSA PRIVATE KEY, EC PRIVATE KEY | Older algorithm-specific private key formats (PKCS#1, SEC1) |
OPENSSH PRIVATE KEY | An SSH private key (not ASN.1) |
Reading the ASN.1 tree
Each line shows a type (such as SEQUENCE, INTEGER or OBJECT IDENTIFIER) and its length in bytes. OIDs are shown with their names, such as 1.2.840.113549.1.1.11 (SHA-256 with RSA); strings and dates are decoded. Bit and octet strings that contain more ASN.1, like the public key inside a certificate, are expanded too. It’s the same information as openssl asn1parse, in a browsable form.
FAQ
What is a PEM file?
A text file containing Base64-encoded binary data between -----BEGIN and -----END lines. It is the usual format for certificates and keys.
What is the difference between PEM and DER?
DER is the binary ASN.1 encoding; PEM is the same bytes Base64-encoded with header lines, so it can be copied as text.
How do I convert DER to PEM?
Run openssl x509 -inform der -in cert.der -out cert.pem, or open the .der file on this page, which converts it automatically.
What is ASN.1?
Abstract Syntax Notation One, the language used to define the structure of certificates, keys and many protocols. DER is its binary encoding.