Running it

How to Test HSTS: Checker, curl, Chrome and Firefox

Five ways to check if HSTS is enabled: an online HSTS checker, curl, Chrome DevTools, chrome://net-internals and Firefox, plus what a failed result means.

Illustration: a magnifying glass over a browser window with a shield and a stopwatch

The fastest check

Enter your address in the free HSTS Checker. It requests the page from our server, reads the Strict-Transport-Security header on the response, and shows the three values that matter: max-age converted to days, whether includeSubDomains is present, and whether preload is present. If anything is missing it says so in plain words.

That answers "is HSTS enabled on this URL" in a few seconds. The rest of this guide covers the other four ways to test, what each one can and cannot tell you, and the result that confuses most people: a site that is clearly on HTTPS but still reports no HSTS.

If you are not sure what the header does yet, start with what HSTS is and why a redirect is not enough and come back.

1. The online HSTS Checker

Here is the checker run against two real addresses on 28 October 2026.

HSTS Checker results: a one year policy for GitHub, no header for an apex
Both are live results from 28 October 2026. The apex fails because its HTTPS redirect to www carries no header, even though the www host sends one.

GitHub returns a one-year policy with both optional directives, the configuration preloaded domains use. The second result is our own apex domain, bitssolved.com, and it fails. That is not a bug in the tool; it is the most common real-world HSTS gap, and section 6 explains it.

Reading the result:

  • max-age is shown in seconds and in days. Anything under 180 days is short; one year is the usual target.
  • includeSubDomains: yes means the rule extends to every subdomain. Good if every subdomain is on HTTPS, dangerous if not.
  • preload: yes means the site is asking to be on the browser preload list. It does not tell you whether it actually is. Check that at hstspreload.org.

Guests get 5 checks a day per tool and a free account gets 50. If you are fixing a whole site, the security headers checker reports HSTS alongside the other headers in one run.

2. curl in a terminal

On macOS, Linux and current Windows, curl is already installed. Ask for the headers only and filter for the one you want:

Shell
curl -sI https://www.example.com | grep -i strict-transport-security

-s hides the progress bar, -I asks for headers only. If the command prints a line, the header is there; if it prints nothing, it is not. On Windows PowerShell, call curl.exe explicitly, because curl alone is an alias for a different command there, and use findstr /i instead of grep.

Two habits make curl far more useful than a quick glance:

Do not follow redirects at first. Without -L, curl shows you the response of the exact URL you typed. That is what you want, because each hop is a separate response and each needs its own header.

Show the status line and location too. This is the same apex and www comparison as the checker above, done by hand:

Terminal output showing an apex domain redirect without HSTS and the www host with HSTS
Checking each host separately with curl, without following redirects, shows exactly which response is missing the header.

The apex answers with a 301 and no HSTS header; the www host answers 200 with a one-year policy. Run both every time you test. If you want to see the whole chain at once, the redirect checker lists every hop, and the HTTP header checker shows every header on a single response.

A few curl traps worth knowing:

  • Some servers answer a HEAD request (-I) differently from a normal GET. If the result looks odd, compare with curl -s -D - -o /dev/null https://www.example.com, which sends a GET and prints only the headers.
  • -k (ignore certificate errors) is fine for testing a staging server, but a browser will ignore HSTS sent over a connection with an invalid certificate, so a result with -k proves nothing about real visitors.
  • Testing http:// with curl will never show a meaningful HSTS header. Browsers ignore the header on plain HTTP responses, so only the https:// result counts.

3. Chrome DevTools

To check the HSTS header in Chrome:

  1. Open the page, then press F12 (or Cmd+Option+I on a Mac) and choose the Network tab.
  2. Reload the page so the requests appear.
  3. Click the first row, the document itself.
  4. In Headers, scroll to Response Headers and look for strict-transport-security.

Make sure you are reading the response for the HTTPS URL, not a cached or redirected row. Tick Preserve log and Disable cache first, so redirects stay visible and you see a fresh response.

DevTools can also prove the browser is enforcing the rule, which no online tool can. With Preserve log on, type the http:// version of the address. If the browser already holds an HSTS rule for that host, the first row will show status 307 Internal Redirect. This is what Chrome reported for that request in our test, captured from its network log:

Text
307 Internal Redirect
Location: https://www.bitssolved.com/
Non-Authoritative-Reason: HSTS

Non-Authoritative-Reason: HSTS means the redirect never came from the server. The browser upgraded the request itself, and no plain HTTP left the machine. If you see a real 301 from the server instead, the browser has no rule for that host yet.

4. chrome://net-internals/#hsts

Chrome keeps its HSTS rules in an internal store you can query. Paste chrome://net-internals/#hsts into the address bar, type a host under Query HSTS domain, and press Query.

Chrome net-internals HSTS page showing a dynamic policy stored for www.bitssolved.com
Only dynamic fields are filled, so the rule came from the header rather than the preload list. Expiry minus observed is exactly one year in seconds.

The fields come in two groups:

  • static_ fields describe the built-in preload list. If static_sts_domain shows your domain and static_upgrade_mode reads FORCE_HTTPS, the domain is preloaded in this version of Chrome.
  • dynamic_ fields describe what this browser learned from the header. dynamic_sts_include_subdomains: true means the header had includeSubDomains. dynamic_sts_observed and dynamic_sts_expiry are Unix timestamps; the gap between them is your max-age. In the screenshot it is exactly 31,536,000 seconds, one year.

"Not found" means this browser has no rule for that exact host. Query the apex and the www host separately; they are different entries, and a rule on www with includeSubDomains covers names below www, not the apex above it.

The same page has Delete domain security policies, which removes a dynamic rule. It is the way out when you sent a bad header while testing and need your own browser to forget it. It cannot remove preloaded entries, and it only clears your browser, not your visitors'.

5. Firefox

In Firefox, open Developer Tools with F12, choose Network, reload, and click the document row. The Headers panel lists Strict-Transport-Security under the response headers. The Security panel for the same request shows the connection details and states whether HTTP Strict Transport Security is enabled for the host.

Firefox has no equivalent of the net-internals query page. It stores learned rules in a file in the profile folder (named SiteSecurityServiceState). To make Firefox forget a site's HSTS rule, open the History library, right-click the site and choose Forget About This Site. That also clears its cookies and history, so use it on a test profile if that matters.

6. What "HSTS not enabled" really means

When a checker reports no HSTS on a site you know is on HTTPS, it is almost always one of these.

The header is only on the www host

This is our own apex result above. bitssolved.com redirects to https://www.bitssolved.com/, and only the www host sends the header. A visitor who types bitssolved.com makes a plain request to the apex, and the browser has no rule for the apex that could have upgraded it. Adding includeSubDomains on www does not help, because it covers names below www, not above it.

The fix is to send the header on the HTTPS redirect response from the apex as well. Most servers only add headers to the host that serves pages, so it takes a deliberate line of configuration. That is on our own list to fix, and the configuration for each server is in common HSTS configuration mistakes.

The header only appears after the redirect

Some tools follow redirects and report the final page; others report the first response. If you check http://shop.com and the tool follows to https://www.shop.com/, you may see a header that the first two hops never sent. Check each hop on its own, starting from the HTTPS apex. The HSTS Checker reports the response for the address you give it, which is why it marked the apex as failing.

The header is on some paths and not others

Nginx drops server-level headers in any location block that sets its own add_header, and many servers skip headers on error pages unless told otherwise. Test a page, a static file such as a stylesheet, and a URL that returns 404. If any of them lacks the header, the configuration has a hole.

The header is sent over plain HTTP only

If curl shows the header on http:// but not on https://, someone configured the port 80 site. Browsers ignore it there, so in practice HSTS is off.

A CDN or proxy sits in front

If you use Cloudflare or another CDN, the header the visitor sees comes from the edge. Cloudflare applies its HSTS setting per hostname and only to proxied hostnames, so a record set to DNS only gets whatever your origin sends, which may be nothing.

Reading max-age in days

max-age is in seconds. Divide by 86,400 to get days:

max-ageDaysVerdict
3000.003 (5 minutes)Testing only
864001Rollout stage
259200030Rollout stage
15552000180Workable, below the preload minimum
31536000365Standard long-term value, the preload minimum
63072000730Common on preloaded sites

A max-age=0 header is not an error; it tells browsers to delete the rule, and sites send it deliberately when undoing HSTS.

A test routine worth keeping

For every domain you look after, run these five checks after any change to the server, CDN or certificate:

  1. https:// apex: header present, or a redirect that carries the header.
  2. https://www. host: header present with the intended max-age.
  3. A static asset and a 404 page on each host: header still present.
  4. Every subdomain, if you use includeSubDomains: valid HTTPS, checked with the SSL checker.
  5. In Chrome, http:// on each host after one HTTPS visit: 307 Internal Redirect with reason HSTS.

HSTS is one line in a longer list; our security headers checklist covers the rest, and checking an SSL certificate and fixing errors matters more once HSTS is on, because certificate errors can no longer be clicked past.

If the results show gaps you would rather hand over, our website fixes work starts from exactly these measurements and ends with the same checks passing.

Tools mentioned in this post