.PEM file extension
To open .PEM files on Windows, open the .pem in a text editor (e.g., Notepad) to confirm it contains “-----BEGIN …-----” / “-----END …-----” blocks.
To open a .pem file, use a certificate/key tool such as OpenSSL, or open it in a plain-text editor to view the BEGIN/END blocks. On servers, .pem files are commonly consumed by TLS software (for example Apache httpd’s mod_ssl) as certificate and key inputs.
Last updated: June 12, 2026
Open on your device
Choose your operating system for a dedicated step-by-step opening guide.
How to open .PEM files
Use these platform-specific instructions to open .PEM files safely.
Windows
- Open the .pem in a text editor (e.g., Notepad) to confirm it contains “-----BEGIN …-----” / “-----END …-----” blocks.
- If you need to inspect or convert it, use OpenSSL command-line tools (they accept PEM as an input/output format) and run the appropriate certificate/key command for your task.
Mac
- Open the .pem in TextEdit (as plain text) to view the BEGIN/END markers and identify whether it is a certificate, key, or chain.
- For validation/conversion, use OpenSSL from the Terminal; OpenSSL tools support PEM as an input/output format.
Linux
- Open the .pem with a text viewer/editor (less, nano, vim) to verify the encapsulation boundaries (BEGIN/END) and see what object type it is.
- Use OpenSSL command-line tools to parse, validate, or convert the PEM content (OpenSSL supports PEM as an input/output format).
iOS
- You can view a .pem as text in a file viewer app to see its BEGIN/END blocks, but most practical operations (validation/conversion or server configuration) are typically done on a desktop/server using OpenSSL.
Android
- Open the .pem in a text-capable file viewer to inspect the BEGIN/END markers; for actual certificate/key operations, transfer it to a desktop/server environment and use OpenSSL.
Security notes
- A .pem file may contain a private key (e.g., “BEGIN PRIVATE KEY” or similar); treat such files as secrets, restrict file permissions, and avoid sending them over insecure channels.
- PEM is human-readable text; it is easy to accidentally paste it into tickets/chats/logs. Be especially careful not to disclose private keys or full certificate chains that reveal internal PKI structure.
- Do not assume “.pem = certificate only”: always inspect the BEGIN/END label before sharing or importing, because keys and CSRs can look similar at a glance.
If you did not expect this file
This extension is usually plain data, text, or structured content—not a program by itself. The practical risk is social engineering (a scam attachment or misleading filename). For trusted senders you rarely need heavy-handed antivirus wording; use these tools when you want an extra check on unexpected downloads.
Avast offers free and premium antivirus software that protects against viruses, malware, ransomware, and phishing. Scan files before opening them to ensure safety.
NortonNorton 360 delivers comprehensive antivirus protection, VPN, and identity theft monitoring. Scan files for threats before opening to keep your device secure.
We may earn a commission when you use affiliate links. This supports our free file extension guides.
Can't open this file?
These are the most common causes and fixes when .PEM files fail to open.
Common reasons
- The file opens as plain text and doesn’t “install” like a certificate
- Server configuration fails because the file is the wrong PEM type (certificate vs key vs chain)
- Paste/email formatting breaks the PEM (invalid Base64 or missing boundaries)
- Certificate chain order is incorrect
Fix steps
- Open the file and check the BEGIN/END label (e.g., CERTIFICATE vs PRIVATE KEY) to identify what it contains.
- Use OpenSSL to inspect/convert as needed; OpenSSL supports PEM as an input/output format.
OS-specific troubleshooting
What is a .PEM file?
PEM is a textual encoding defined in RFC 7468: Base64-encoded data wrapped in “-----BEGIN …-----” and “-----END …-----” encapsulation boundaries. A .pem file may contain a certificate, a private key, a certificate signing request (CSR), a CRL, or a certificate chain; IANA also registers the media type application/pem-certificate-chain for certificate chains. OpenSSL tools and libraries can read and write PEM as an input/output format for cryptographic material.
Background
Because PEM is plain text, it’s easy to inspect in a text editor; however, the contents can be sensitive when a private key is included. OpenSSL provides both APIs and command-line tools that accept PEM alongside other formats (such as DER and PKCS#12) for converting, inspecting, and using certificates and keys.
Common MIME types: application/pem-certificate-chain
Further reading
Authoritative resources for more details on the .PEM format.
Common .PEM issues
The file opens as plain text and doesn’t “install” like a certificate
PEM is an encoding/container; it can hold different objects (certificate, key, CSR, chain). Many systems expect specific certificate stores or different file formats for import, so double-clicking may just show text.
- Open the file and check the BEGIN/END label (e.g., CERTIFICATE vs PRIVATE KEY) to identify what it contains.
- Use OpenSSL to inspect/convert as needed; OpenSSL supports PEM as an input/output format.
Server configuration fails because the file is the wrong PEM type (certificate vs key vs chain)
TLS server configuration typically requires separate files or specific ordering (certificate and matching private key, plus intermediates). A .pem might contain only a leaf certificate, only a key, or a full chain.
- Verify which blocks are present by opening the .pem and reading the BEGIN/END lines.
- If configuring Apache httpd with mod_ssl, ensure you are providing the correct PEM-encoded X.509 certificate and the corresponding PEM-encoded key as required by your configuration.
Paste/email formatting breaks the PEM (invalid Base64 or missing boundaries)
PEM relies on exact encapsulation boundaries and valid Base64 content. Extra spaces, missing dashes, or truncated lines can make tools reject the file.
- Confirm the file contains intact “-----BEGIN …-----” and “-----END …-----” lines with no extra characters.
- Re-export or re-download the PEM from the original source if the file appears altered, then re-try with OpenSSL.
Certificate chain order is incorrect
When a .pem contains a certificate chain (multiple CERTIFICATE blocks), some software expects a particular ordering (typically leaf first, then intermediates). The IANA-registered media type application/pem-certificate-chain is specifically for certificate chains in PEM encoding.
- Check whether the .pem contains multiple CERTIFICATE blocks (a chain).
- If your TLS software rejects it, rebuild the chain file in the order expected by that software and re-test.
FAQ
What is inside a .pem file?
PEM is a text encoding (RFC 7468) that wraps Base64 data between BEGIN/END boundary lines. A .pem can contain certificates, private keys, CSRs, CRLs, or a certificate chain (multiple certificates).
Is .pem the same as .crt or .cer?
They can represent the same kind of certificate, but the difference is often the encoding and conventions. PEM is the textual Base64-with-boundaries encoding; some .crt/.cer files are PEM, while others may be DER (binary).
How do I know if my .pem contains a private key?
Open it in a text editor and look at the first BEGIN line. If it says something like “BEGIN PRIVATE KEY” (or another key label), it contains a private key and should be protected.
What MIME type is associated with PEM certificate chains?
IANA registers application/pem-certificate-chain for PEM-encoded certificate chains, and it lists .pem as a file extension.
Similar file extensions
Compare related formats in the same category to find the right tool faster.
- .pfx - Personal Information Exchange (PFX)
- .p12 - PKCS#12 Certificate Bundle
- .csr - PKCS #10 Certificate Signing Request
- .der - DER-encoded X.509 Certificate
- .p7b - PKCS #7 Certificate Bundle (P7B)
- .ac - X.509 Attribute Certificate
- .p7s - PKCS #7 / S/MIME Digital Signature (detached signature)
- .p7c - PKCS #7 / CMS certificate container (certs-only SignedData)