How to Check an SSL Certificate's Expiration Date (Without OpenSSL)
How to check an SSL certificate's expiration date without OpenSSL — paste a cert or check a live domain, right in your browser.
Try it now: SSL Certificate Decoder — Decode a PEM X.509 SSL certificate to read its subject, issuer, SANs, key size and expiry date — parsed in your browser, never uploaded.
Step 1: Check the Live Certificate in Your Browser
If the site is one you can visit right now, the fastest way to check certificate expiry is the padlock icon in the address bar — no tools required. In Chrome, click the padlock (or the tune icon next to the URL), open “Connection is secure,” then “Certificate is valid” to see the details panel. Firefox shows the same information behind the padlock → “More Information” → “View Certificate.” Look for the field labeled Valid to or Expires on — that's the certificate's notAfter date.
- Click the padlock or security indicator to the left of the address bar.
- Open the certificate details view (wording varies slightly by browser).
- Find the validity period — most browsers show both Valid from and Valid to, sometimes labeled Issued on / Expires on.
This is the quickest path when you want a one-off answer for a site that's currently loading in your tab. The catch: it only shows the certificate the server is serving at this exact moment, to your browser, over your current connection. If you need to check expiry for a site you can't reach — behind a firewall, not yet deployed, or on a staging host that isn't publicly resolvable — the browser has nothing to inspect, and you need one of the two methods below instead.
Step 2: Check It From the Command Line With OpenSSL
The command-line equivalent connects to the server directly and pulls the certificate over the wire. It's the standard answer to how to check ssl certificate expiration date for anyone comfortable in a terminal, and it works against any host and port, not just port 443 in a browser tab:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \ | openssl x509 -noout -dates
notBefore=Feb 10 00:00:00 2026 GMT notAfter=May 11 23:59:59 2026 GMT
Be honest with yourself about why this command is annoying rather than pretending it's simple: openssl s_client opens an interactive TLS connection and, left alone, it just sits there waiting on stdin instead of exiting — which is why the echo | in front is piping in an empty line to close it automatically. The -servernameflag is easy to forget and, when it's missing on a host using SNI (nearly every host today), you can get the wrong certificate back — say, the server's default cert instead of the one for the domain you actually asked about. And s_clientalone doesn't print human-readable dates at all: it dumps the full connection handshake and the raw PEM certificate, which is why a second invocation — openssl x509 -noout -dates — is piped in afterward just to parse that PEM into the two lines you actually wanted. Three separate details, in one line, none of them obvious from the flag names — which is exactly why this is a command most people look up again every single time instead of memorizing it.
Step 3: Decode a Certificate File Directly, Without a Live Connection
The OpenSSL command above needs something to connect to. If what you actually have is a file — a .pem or .crtpulled from a server config, a certificate a CA just issued that you're about to deploy, or one leg of a chain you downloaded to debug — there's no host to dial, and running s_client against nothing doesn't apply. This is the case a certificate decoder — the browser-based, no-command-line alternative to the OpenSSL method — is built for.
- Open GenKitLab's Certificate Decoder.
- Paste the full
-----BEGIN CERTIFICATE-----block, or drop the.pem/.crtfile onto the page. - Read the parsed Valid To field directly — alongside subject, issuer, SANs, and key size, decoded in the same pass.
Here's the detail that explains why pasting a certificate into a plain text viewer never works: the expiry date inside a certificate isn't stored as a readable string like "May 11 2026". It's an ASN.1 Validity structure, and its notAfter field is encoded as either UTCTime (two-digit years, used through 2049) or GeneralizedTime (four-digit years, required from 2050 onward) — both packed binary formats, not text. A tool that just displays the raw bytes of a PEM file shows you base64; to get a human date out, something has to base64-decode the certificate, walk the DER-encoded ASN.1 structure to find the Validity field, and then convert that UTCTime/GeneralizedTimevalue into a normal date. That parsing step is the entire job of a real ssl certificate decoder — it's not optional formatting, it's the only way the date becomes readable at all.
# raw ASN.1 (DER, base64-encoded in the PEM) — not human-readable
30 1e 17 0d 32 36 30 32 31 30 30 30 30 30 30 30 5a
^^ UTCTime tag ^^ "260210000000Z"
# decoded and shown by the tool
Valid From: 2026-02-10 00:00:00 UTC
Valid To: 2026-05-11 23:59:59 UTCGenKitLab's decoder does this parsing entirely in your browser using the Web Crypto and native ASN.1 decoding APIs already built into the JavaScript runtime — nothing you paste is uploaded to a server, which matters if the certificate belongs to an internal system or hasn't been deployed publicly yet. In that sense it's a straightforward openssl alternative for this one job: no terminal, no remembering flag order, no piping one command into another — paste the cert, read the date.
Which Method to Use, and When
- Use the browser padlockwhen you just need a quick answer for a site you're already viewing, right now, over a normal public connection.
- Use OpenSSLwhen you need to check certificate expiry for a live host — especially in a script, a monitoring check, or a CI job where a browser isn't available — and you're fine re-deriving the flag combination or keeping it in your notes.
- Use a certificate decoderwhen you're starting from a file rather than a live connection — a cert from a config, a chain you downloaded, one you're about to install — or when you'd rather read a parsed
Valid Tofield than assemble a two-command OpenSSL pipeline from memory.
For the full breakdown of everything else a certificate contains beyond the expiry date — subject, issuer, Subject Alternative Names, key algorithm and size, serial number — see the companion reference, SSL Certificate Decoder: Reading Every Field, or open the Certificate Decoder directly and decode one now.
Frequently asked questions
›How do I check when an SSL certificate expires without using the command line?
For a site you can visit, click the padlock icon in the address bar and open the certificate details — the "Valid to" or "Expires on" field is the expiry date. For a certificate file you already have (a .pem or .crt), paste it into a browser-based certificate decoder and read the parsed Valid To field directly, no terminal needed.
›Why doesn't openssl s_client just print the expiry date directly?
s_client establishes and dumps a full TLS handshake — it isn't built to summarize dates. You pipe its output into a second command, openssl x509 -noout -dates, which parses the certificate it retrieved and prints just notBefore and notAfter. It's two commands doing two different jobs, which is exactly why the combined one-liner is easy to forget.
›Why does the openssl s_client command need `echo |` in front of it?
s_client opens an interactive connection and waits on stdin by default — it doesn't exit on its own after fetching the certificate. Piping in an empty line (echo |) gives it something to read immediately, so the connection closes and control returns to your shell instead of hanging.
›What format is the expiration date stored in inside a certificate?
It's an ASN.1 field called notAfter, encoded as UTCTime (two-digit year, valid through 2049) or GeneralizedTime (four-digit year, required from 2050 onward) — both binary, DER-encoded formats, not human-readable text. A decoder has to parse the ASN.1 structure and convert that value into a normal date; you can't read it by opening the file in a text editor.
›Is a browser-based certificate decoder a real alternative to openssl?
For reading a certificate's fields — expiry, subject, issuer, SANs, key size — yes: it parses the same ASN.1 structure openssl x509 does, just in the browser instead of a terminal, and without needing a live connection to the server. It doesn't replace openssl for actions like generating keys or signing requests, but for decoding an existing cert it's a faster, no-command path to the same information.
›Is it safe to paste a certificate into an online decoder?
A public certificate itself contains no private key material, so pasting one carries no secret-exposure risk on its own — but where the parsing happens still matters if the cert is for an internal or unreleased system. GenKitLab's decoder parses entirely client-side in your browser; nothing you paste is uploaded to a server.
Last updated