PEM Decoder

Paste PEM text below, or open a file, to see what is inside it. The decoder reads certificates, certificate signing requests (CSRs) and public keys, and it never leaves your browser. If you only want to read an SSL/TLS certificate, use the certificate decoder.

🔒 Your privacy is protected: All decoding happens entirely within your web browser using client-side JavaScript. What you paste or open is never sent to our server. Private keys are refused on purpose.

Paste or drop PEM text below, or open a PEM file


Decoded Information: N/A


What is a PEM file?

A PEM file is plain text that holds binary data as base64 between a -----BEGIN LABEL----- line and a matching -----END LABEL----- line. The label says what kind of data it is. The format is described in RFC 7468. Because it is only text, it survives being pasted into an email or a web form.

One file can hold several blocks, for example a server certificate followed by its intermediate certificates, or a certificate next to its key. Text outside the blocks is ignored. Extensions such as .pem, .crt, .cer, .csr and .key are only habits: the label inside the file is what counts. If you only need to read an SSL/TLS certificate, the certificate decoder home page explains every row of the result.

Common PEM labels

This is what the page does with each label. "Listed, not decoded" means the page tells you the block is there and which openssl command reads it. Up to 10 certificates, CSRs and public keys are decoded from one input.

LabelWhat it isOn this page
CERTIFICATE, X509 CERTIFICATEAn X.509 certificateDecoded
CERTIFICATE REQUEST, NEW CERTIFICATE REQUESTA certificate signing request (CSR)Decoded
PUBLIC KEYA public key, in the general SPKI formatDecoded
RSA PUBLIC KEYAn RSA public key, in the older PKCS#1 formatDecoded
PRIVATE KEY, ENCRYPTED PRIVATE KEY, RSA PRIVATE KEY, EC PRIVATE KEY, DSA PRIVATE KEY, OPENSSH PRIVATE KEY, and any other label containing PRIVATE KEYA private keyIgnored on purpose: never read or decoded
TRUSTED CERTIFICATEAn OpenSSL certificate with trust settingsListed, not decoded
X509 CRLA certificate revocation listListed, not decoded
PKCS7, CMSA bundle of certificates, or a signed messageListed, not decoded
EC PARAMETERS, DH PARAMETERS, DSA PARAMETERSKey parametersListed, not decoded

Any other label is listed as an unknown block, without a command.

How to see what is inside a .pem file

The page above does this for you. On your own machine, openssl reads each type like this:

Check that a key matches a certificate without the private key

A certificate and its private key belong together when they share the same public key. You can test that without ever showing the private key to a website. First, on your own machine, print the public half of the key:

openssl pkey -in key.pem -pubout

Paste that output (a BEGIN PUBLIC KEY block) into the box next to the certificate, or next to the CSR, and press Decode PEM. The summary says which certificate each public key or CSR matches, or that it matches none. The comparison is exact: the whole public key, including its algorithm, must be identical.

Or skip the page and compare hashes locally. The two commands print the same value when the key belongs to the certificate:

openssl x509 -in cert.pem -noout -pubkey | openssl sha256
openssl pkey -in key.pem -pubout | openssl sha256

If the key file is encrypted, openssl asks for the passphrase on your machine; it never reaches this page.

PEM, DER and base64

DER is the same data in its raw binary form; PEM is that binary turned into base64 text with BEGIN and END lines. This page opens PEM text, DER files, and bare base64 with no BEGIN and END lines (as found in SAML metadata). For bare base64 and DER, the page tries a certificate first, then a CSR, then a public key, and fills the box with the PEM it made. A DKIM public key works too: paste the whole DNS record (v=DKIM1; k=rsa; p=MIIB…) or just the key, and the page takes the key after p=. The longer explanation of PEM, CRT, CER and DER is on the home page.

Frequently asked questions

Is it safe to paste a PEM file into this site?

Yes, for certificates, CSRs and public keys, which are all meant to be shared. Decoding runs in JavaScript inside your browser, and nothing you paste or open is uploaded. The page's analytics record how many certificates, CSRs and public keys were decoded, how the input arrived (pasted or from a file; as PEM, DER or base64) and whether a private key was present and ignored, never anything from inside them. Do not paste a private key: this page does not need one, and it does not read one.

Why won't this page read my private key?

On purpose. A private key is the one secret that protects a certificate, and it should stay on the server it belongs to; there is nothing a decoder can tell you that is worth the risk of typing it into a web page. If a pasted or opened text holds a block with PRIVATE KEY in its label (including ENCRYPTED PRIVATE KEY and OPENSSH PRIVATE KEY), the page only says that one was found; it is never decoded, and for an opened file it is removed from the box. There is no passphrase field. To work with a key, use openssl on your own machine.

How do I check that my key matches my certificate?

Without pasting the private key: run openssl pkey -in key.pem -pubout on your own machine, then paste the public key it prints into the box next to the certificate. The summary says which certificate the public key matches, or that it matches none. You can also compare hashes locally: openssl x509 -in cert.pem -noout -pubkey | openssl sha256 and openssl pkey -in key.pem -pubout | openssl sha256 print the same value when the key belongs to the certificate.

What is the difference between BEGIN PUBLIC KEY and BEGIN RSA PUBLIC KEY?

BEGIN PUBLIC KEY is the general format (SubjectPublicKeyInfo, or SPKI): it names the algorithm, so it can hold RSA, EC, Ed25519 and other keys. BEGIN RSA PUBLIC KEY is the older PKCS#1 format and holds an RSA key only, with no algorithm name. This page reads both, and shows them the same way. To convert one to the other, use openssl rsa -RSAPublicKey_in -in old.pem -pubout.

Can I decode a CSR here?

Yes. Paste or open a certificate signing request (BEGIN CERTIFICATE REQUEST or BEGIN NEW CERTIFICATE REQUEST, usually a .csr file) and the page shows the subject, the names requested in Subject Alternative Names and the public key, and checks the request's signature. If your browser cannot check the signature algorithm (for example secp256k1, brainpool curves, DSA, Ed448 or MD5), it says the signature was not checked rather than guessing. A CSR and a certificate in the same input are compared, and the summary says whether they share a public key.

What if my file is .pfx, .p12 or .p7b?

A .pfx or .p12 file (PKCS#12) is binary and usually holds a private key, so this page does not accept it. A .p7b file (PKCS#7) is not decoded here either. Convert it on your own machine instead: openssl pkcs12 -in bundle.pfx -nokeys -clcerts prints the certificate without the key, and openssl pkcs7 -print_certs -in bundle.p7b prints the certificates in a .p7b bundle. Paste the PEM output here.