What is .pem?

.pem files are text-based containers that store cryptographic material such as X.509 certificates, certificate chains, and private keys. The data inside is Base64-encoded and wrapped between header and footer lines like '-----BEGIN CERTIFICATE-----' and '-----END CERTIFICATE-----', making PEM easy to copy, paste, and transport as text.

This quick guide explains when to use .pem files, how to open them on any device, and how to share them instantly with FileXhost.

When to use .pem files

  • You are configuring HTTPS/TLS for web servers, proxies, or load balancers.
  • You need to store or share public certificates, certificate chains, or private keys in a text-friendly format.
  • You are working with OpenSSL, Kubernetes secrets, or cloud services that expect PEM-encoded material.
  • You need a portable way to move certificates and keys between systems or tools.

How to open .pem files

PEM files can be opened in any text editor to inspect the headers and Base64-encoded data. For deeper inspection and validation, use tools like OpenSSL, keytool, or platform certificate managers to parse and display details about the certificate or key. When you upload PEM files to FileXhost, they are treated as sensitive text/binary data that collaborators can download securely to configure servers or applications.

Algorithm details

PEM itself is a container format rather than a specific cryptographic algorithm. It wraps binary data (such as DER-encoded X.509 certificates or PKCS#8 keys) in Base64 with ASCII armor headers and footers. The underlying certificate or key may use algorithms like RSA, ECDSA, or EdDSA. Because PEM is text-based, it works well in configuration files, environment variables, and version-controlled repositories (with appropriate security controls).

Browser & platform support

  • Desktop: Browsers do not directly render PEM files, but they can be downloaded and used to configure client or server certificates.
  • Mobile: Mobile devices typically handle PEM files through apps or system certificate stores rather than in the browser UI.
  • OS: Operating systems provide certificate managers or command-line tools to import PEM certificates into trust stores or keychains.

Format comparison

FeatureDetails
EncodingPEM uses Base64-encoded text with headers and footers, while DER and many PFX files store the same data in binary form.
UsageCommonly used for server certificates, intermediate chains, and private keys in web and infrastructure tooling.
Human ReadabilityHuman-readable headers and text-friendly format, but the Base64 payload itself is not meant to be manually edited.
PortabilityEasy to copy, paste, and move between systems, scripts, and configuration files compared to raw binary formats.

How to create pem files

  • OpenSSL: Generate keys and certificates as PEM using commands like 'openssl genpkey' and 'openssl req'.
  • Certificate Authorities: Many CAs issue server and client certificates in PEM format for web servers and APIs.
  • Conversion: Convert from DER, PFX/P12, or other certificate containers into PEM using OpenSSL or similar tools.
  • Infrastructure Tools: Automation tools and platforms (Terraform, Ansible, Kubernetes) often produce or consume PEM files for TLS.

How to convert pem files

  • FileXhost: Store and distribute PEM files through FileXhost so operators can download them and import certificates where needed.
  • OpenSSL CLI: Use OpenSSL to convert between PEM, DER, and PFX/P12 formats or to extract individual certificates and keys.
  • Key and Certificate Managers: Use platform-specific utilities (keytool, certutil, Keychain Access) to import/export PEM material.
  • Online Tools: Some web tools can inspect or convert PEM files, though caution is advised when handling private keys.

Advantages & disadvantages

Advantages

  • Text-based and easy to store, review, and transport
  • Widely supported across TLS, PKI, and infrastructure tooling
  • Can bundle certificate chains and keys in a consistent format

Disadvantages

  • Plaintext containers for highly sensitive material if private keys are included
  • Multiple PEM variants (cert, key, chain) can be confusing without clear naming
  • Accidental exposure in logs, repos, or config files can lead to security incidents

Tools & software

CLI Tools

OpenSSL, keytool, certutil, CFSSL

Servers/Proxies

Nginx, Apache HTTP Server, HAProxy, Envoy, Traefik

OS & Cloud

Windows Certificate Manager, macOS Keychain Access, Linux trust stores, cloud certificate managers

Frequently asked questions

Is a PEM file a certificate or a key?

PEM is a container; it can hold certificates, private keys, certificate chains, or a combination. The header lines (for example, 'BEGIN CERTIFICATE' or 'BEGIN PRIVATE KEY') indicate what is inside a particular PEM file.

How do I convert a PEM file to PFX/P12?

Use OpenSSL with commands like 'openssl pkcs12 -export' to combine a PEM certificate and private key into a PFX/P12 file for import into Windows or other systems that expect PKCS#12 containers.

Is it safe to store PEM files in version control?

Public certificates in PEM can be stored safely, but private keys must be treated as secrets. Avoid committing private-key PEM files to source control and instead use secret managers or secure storage.

Why do I have multiple PEM files from my certificate authority?

You may receive separate PEM files for your leaf certificate, intermediate certificates, and root certificates. Web servers often require you to combine the leaf and intermediate certificates into a single PEM chain file for proper TLS configuration.

Technical specs

File type
Security
Extension
.pem
MIME type
application/x-pem-file, application/x-x509-ca-cert, text/plain
Compression
Uncompressed
Max file size on FileXhost
Up to 25 MB per file on the free plan and up to 1 GB on Pro FileXhost accounts.

Share .pem files instantly

Upload your .pem file to FileXhost to get a clean, shareable URL in seconds. View the file in a modern browser, protect access with optional settings, and let others download it without any confusing ads or cluttered file pages.

Upload .pem file