Certificate key matcher

Check that a private key belongs to its certificate, or to the request (CSR) it was made with, before you install it. Both files stay on your device.

Try:
Checked on this device, never uploaded

How to check a private key matches a certificate

Short answer

Drop the certificate on the left and the private key on the right. They match when both hold the same public key, which is worked out from the private key on your device; the answer shows straight away with the fingerprints of each.

  1. Add the certificate

    A .crt, .cer or .pem file, a whole fullchain.pem, or a request (CSR). Pasted PEM text works too.

  2. Add the private key

    The .key or .pem file saved when the request was made. PKCS#8, PKCS#1 and EC keys are read.

  3. Read the answer

    They match, or they don’t. The public key SHA-256 of each side is shown, and for RSA the modulus MD5 that OpenSSL prints.

The same check with OpenSSL

Compare the public keys: the two outputs are the same when the key belongs to the certificate.

openssl x509 -in certificate.crt -noout -pubkey | openssl sha256
openssl pkey -in private.key -pubout | openssl sha256

For RSA, the modulus MD5 on this page is what these print on Linux and macOS. On Windows, OpenSSL ends the line differently and prints another MD5: compare the SHA-256 there.

openssl x509 -in certificate.crt -noout -modulus | openssl md5
openssl rsa -in private.key -noout -modulus | openssl md5

Specs

Certificate sideCertificates (PEM, DER, CRT, CER, P7B, fullchain), requests (CSR) and public keys
Key sidePrivate keys as PKCS#8, PKCS#1 or SEC1, RSA, EC and Ed25519
ShownKey type and size, public key SHA-256, RSA modulus MD5
Not readPassword-protected keys
PriceFree, no account

Questions

Is my private key uploaded?

No. Both files are read by your browser and compared on your device. Nothing is sent anywhere.

How do I know a key matches a certificate?

A certificate holds a public key, and a private key has exactly one public key that belongs to it. They match when the two public keys are the same, which this page checks and shows as SHA-256 fingerprints.

The key doesn’t match. What now?

The certificate was issued for the request (CSR) made together with another key. Look for the .key file saved when that request was made, often next to the CSR or on the server it was made on. Without it, make a new request and have the certificate reissued.

Can I check a CSR against a key or a certificate?

Yes. Put the CSR on the left and the private key on the right to see if the request was made with that key, or a certificate and a CSR to see if the certificate was issued for that request.

What about nginx’s “key values mismatch” error?

nginx and Apache give it when ssl_certificate and ssl_certificate_key do not match. Check the two files here; with a fullchain.pem the certificate that matches is found among the others.