PEM KEY
File conversion

Convert PEM to KEY

QUICK ANSWER
Is it possible to convert PEM to KEY?
Yes - PEM converts to KEY.

Open the .pem in a text editor. If the first line is -----BEGIN PRIVATE KEY----- (or similar), rename the file to .key and it will work as-is. For a combined .pem that bundles a certificate and key, run openssl pkey -in combined.pem -out private.key to extract just the key.

Also to KEY: PFX · P12 · PPSX

On this page

Tested on macOS, Windows & Linux
Last verified Oct 2026

More free converters

HEIC, PNG, WEBP, MP3 and more - every tool here is free.

Open the toolbox

Why convert PEM to KEY?

Web servers, load balancers, and TLS configuration tools often expect the certificate and private key in separate files - the certificate as .crt or .pem, the private key as .key. Splitting a combined .pem into a .key file lets each server directive point at the correct file without ambiguity.

How to convert PEM to KEY

OpenSSL FREE

Run openssl pkey -in combined.pem -out private.key to extract the private key; verify with openssl pkey -in private.key -check. OpenSSL is FREE and runs on Windows, macOS, and Linux.

About these formats

Quality & what to watch

  • If the .pem contains only a private key (-----BEGIN PRIVATE KEY----- or -----BEGIN RSA PRIVATE KEY-----), renaming it to .key is sufficient - no conversion is needed.
  • On Linux and macOS, set strict file permissions after extraction: chmod 600 private.key - the key is as sensitive as a password.
  • Never upload a private key to an online converter; perform the extraction locally only.

Frequently asked questions

Do I need OpenSSL to extract a private key from a combined PEM?
Not always - you can open the .pem in a text editor, copy only the key block, and paste it into a new file saved as .key.
My `.pem` starts with `-----BEGIN CERTIFICATE-----`. What does that mean?
That is a certificate, not a private key - look for a separate file with a -----BEGIN PRIVATE KEY----- block.
What is the difference between `-----BEGIN PRIVATE KEY-----` and `-----BEGIN RSA PRIVATE KEY-----`?
The first is the generic PKCS#8 format; the second is the older PKCS#1 RSA-specific format. Both are valid private key files; use openssl pkey to extract either.
Where do I get OpenSSL on Windows?
Download it from slproweb.com or use the version bundled with Git for Windows; it is pre-installed on macOS and most Linux distributions.