.PEM

PEM File

PEM - Base64-encoded certificate / key container (X.509, PKCS)
Ask a question
QUICK ANSWER

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 OpenSSL to inspect or convert it. If the file contains a PRIVATE KEY, treat it like a password and never upload it anywhere.

Developer: IETF (PEM encoding, RFC 7468); the name dates to the 1990s 'Privacy-Enhanced Mail' work Category: Security / Certificate Files Open standard MIME: application/x-pem-file
OPENS ON Windows macOS Linux
Related: .P7M · .CER · .REQ · .CRT

On this page

19k+ extensions indexed
Last reviewed Jul 2, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the PEM file format?

PEM file extension is used by certificate files to store and transport cryptographic keys, certificates and other types of data. PEM files are Base64-encoded and store data in ASCII text format - every block is wrapped in recognizable header and footer lines such as -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----.

PEM-encoded certificate files are frequently used on internet servers as they are easy to view using any standard text editor. PEM files are used for authenticating trusted websites and are the default format on Unix-based web servers such as Apache and Nginx. A single .pem file may bundle multiple blocks - for example, a server certificate, intermediate certificates, and a private key - all in one file. PEM is also widely used for SSH key pairs and TLS/HTTPS configuration.

PEM certificate uses a digitally-signed public key for security purposes. The authentication process uses the public key to identify the owner of the key and confirm they are who they claim to be. Private keys stored in .pem files can optionally be protected with a passphrase for additional security.

Originally designed for Privacy-Enhanced Mail in the early 1990s, the PEM encoding was formalized as an IETF standard in RFC 7468 (2015). It remains the most widely used container format for X.509 certificates and cryptographic keys. Related binary formats include .DER and PKCS#12 files; .crt and .key files are often simply renamed .pem files containing a certificate or key respectively.

  • PEM files are supported by OpenSSL and most TLS/SSL toolkits.
  • Opening a .pem file with a text editor clearly shows the marked -----BEGIN----- and -----END----- header and footer sections.
  • A single .pem file may hold different object types: CERTIFICATE, PRIVATE KEY, RSA PRIVATE KEY, PUBLIC KEY, CERTIFICATE REQUEST, and others.

Security & safety

RISK: HIGH

The danger with .pem is the PRIVATE KEY case. A .pem containing '-----BEGIN PRIVATE KEY-----' (or RSA/EC PRIVATE KEY) is a secret: anyone who has it can impersonate your server, decrypt traffic, or log into your cloud instance. NEVER paste a private-key .pem into an online 'PEM viewer/converter' or email it; do conversions locally with OpenSSL. Set strict permissions (SSH refuses a key that's world-readable - 'chmod 600 key.pem'). A .pem that is only a CERTIFICATE (public) is safe to share. Be wary of online certificate converters for anything involving a key. The files themselves are inert text and can't execute.

Format details

in a nutshell
FULL NAMEPEM - Base64-encoded certificate / key container (X.509, PKCS)
DEVELOPERIETF (PEM encoding, RFC 7468); the name dates to the 1990s 'Privacy-Enhanced Mail' worksince PEM email RFCs 1421-1424 (1993); the encoding lives on as the textual format, codified in RFC 7468 (2015)
MIME TYPEapplication/x-pem-file
TYPEPlain-text Base64 (DER data wrapped in -----BEGIN/END----- lines)
STANDARDOpen · royalty-free

Programs that open PEM files

Windows3 apps
OpenSSL Open-source Inspect/convert from the command line: 'openssl x509 -in cert.pem -text -noout' to read a certificate; 'openssl pkcs12 -export ...' to make a .pfx. The core tool for PEM.
Windows Certificate Manager (certmgr) Built-in Double-click a certificate .pem/.cer to view it, or import via certmgr.msc into the certificate store. (For a .pem that is a PRIVATE KEY, Windows can't 'open' it usefully - convert to .pfx first.)
Notepad / any text editor Open-source Open as text to see the '-----BEGIN ...-----' header and tell whether it's a certificate or a key. Don't paste a private key anywhere untrusted.
macOS2 apps
Keychain Access Built-in Double-click/import a certificate .pem to view and trust it. For a private-key .pem, import it into the keychain or convert with OpenSSL as needed.
OpenSSL / LibreSSL Open-source In Terminal, inspect ('openssl x509 -in cert.pem -noout -text') or convert to other formats. Pre-installed (LibreSSL) on macOS.
Linux2 apps
OpenSSL Open-source Pre-installed: read a cert ('openssl x509 -in cert.pem -text -noout'), check a key ('openssl rsa -in key.pem -check'), or convert formats. The standard way to work with .pem.
ssh / web servers (use it) Open-source SSH key case: 'chmod 600 key.pem' then 'ssh -i key.pem user@host'. Server case: reference the .pem in Apache (SSLCertificateFile) or Nginx (ssl_certificate).

Technical details

deep spec
EncodingBase64-encoded DER data wrapped in ASCII header and footer lines
File structureOne or more PEM blocks, each delimited by `-----BEGIN <type>-----` and `-----END <type>-----` lines
Underlying binary formatDER (Distinguished Encoding Rules), a binary ASN.1 serialization format
MIME type`application/x-pem-file`
Supported object types`CERTIFICATE`, `PRIVATE KEY`, `RSA PRIVATE KEY`, `PUBLIC KEY`, `CERTIFICATE REQUEST`
Line length conventionBase64 data wrapped at 64 characters per line per RFC 7468
Multi-object supportA single `.pem` file may concatenate multiple PEM blocks, such as a full certificate chain plus a private key
Common alternate extensions`.crt`, `.cer`, `.key`, `.ca-bundle` - same PEM format, different naming conventions by role
Private key protectionKey blocks can be encrypted with a passphrase using PKCS#8 or legacy PEM encryption headers
Primary use casesTLS/HTTPS server certificates, SSH key pairs, CA certificate bundles, code-signing certificates
InteroperabilityConvertible to binary `.der` with `openssl x509 -outform DER`; PKCS#12 (`.p12`) files can be exported to PEM
Character setUS-ASCII only - Base64 alphabet (A-Z, a-z, 0-9, +, /) plus header/footer dashes and type labels
Newline handlingRFC 7468 mandates LF (\n) line endings; many tools also accept CRLF for legacy compatibility
Header/footer syntaxFive dashes, `BEGIN` or `END`, a space, the object type label, five dashes - e.g. `-----BEGIN CERTIFICATE-----`
ReleasedPEM email RFCs 1421-1424 (1993); the encoding lives on as the textual format, codified in RFC 7468 (2015)
Open standardYes · royalty-free
Specificationwww.rfc-editor.org

PEM conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with PEM files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about PEM files.

Frequently asked questions

What is a .pem file?
A text container for cryptographic data - usually an SSL/TLS certificate, a private/public key, or a certificate chain - stored as Base64 between '-----BEGIN ...-----' and '-----END ...-----' lines. The header line tells you whether it's a certificate or a key.
How do I open a .pem file?
To see what it is, open it in any text editor and read the BEGIN line. To actually use it, point software at it: OpenSSL to inspect/convert, a web server to serve a certificate, or 'ssh -i key.pem' to connect to a server. Don't expect a document to appear - it's a cert/key.
How do I use a .pem file to SSH into AWS / a cloud server?
On Linux/macOS: 'chmod 600 key.pem' then 'ssh -i key.pem user@host'. On Windows, either use OpenSSH the same way, or convert the .pem to .ppk with PuTTYgen and connect with PuTTY.
How do I convert a .pem to .pfx (or .crt/.key)?
Use OpenSSL. To .pfx: 'openssl pkcs12 -export -in cert.pem -inkey key.pem -out out.pfx'. A PEM certificate often already serves as a .crt; to split the key out, copy its BEGIN PRIVATE KEY block into a .key file.
Is it safe to share or upload my .pem file?
Only if it's a certificate (public). If the .pem contains a PRIVATE KEY, treat it as a password - never upload it to online converters or send it by email; anyone with it can impersonate you. Do conversions locally.
What's the difference between .pem, .crt, .cer, and .key?
They overlap. .pem is the Base64 text encoding; .crt/.cer usually hold a certificate (in PEM or binary DER); .key holds a private key (often PEM-encoded). The same certificate can be a .pem or .crt; the difference is mostly the extension/convention and text-vs-binary.

References

1RFC 7468 - Textual Encodings of PKIX/PKCS/CMS (PEM)www.rfc-editor.org
2OpenSSL - documentationwww.openssl.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.BINCD/DVD Disc Image (BIN/CUE)
3.CRDOWNLOADChrome Partial Download File
4.MDMarkdown Document
5.RPMSGRestricted Permission Message
6.PARTPartial Download File
7.NOMEDIAAndroid No-Media Marker File
8.EXEWindows Executable (Portable Executable)
9.SWFSmall Web Format (Shockwave Flash)
10.DBSQLite Database File

Related extensions

.P7MPKCS#7 / S/MIME Message (digitally signed or encrypted)
.CERSecurity certificate (X.509 .cer)
.REQCertificate Signing Request (CSR) - .req
.CRTSecurity certificate (X.509 .crt)
.CSRCertificate Signing Request (PKCS#10)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z