How to Check a Website's HTTP Headers (and the Security Headers to Look For)
See any site's HTTP response headers online, in Chrome or with curl, check the security headers that matter, and copy the config to add the missing ones.
To check a website's HTTP headers, paste the address into our HTTP Headers Parser, open your browser's developer tools (F12, then the Network tab), or run curl -I https://example.com in a terminal. All three show the response headers the server sends back: the status, caching, compression, cookies and the security headers that tell browsers how to protect your visitors.
Below is each method with real output, then the security headers worth having in 2026, the old ones you can drop, and copy-paste config for Apache, Nginx and Cloudflare.
What HTTP headers are
Every time a browser loads a page it sends a request with a few headers, and the server answers with a status line, its own headers and then the page. A trimmed example:
GET / HTTP/1.1
Host: seopeck.com
Accept-Language: en
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Cache-Control: max-age=300, public, s-maxage=1800
strict-transport-security: max-age=31536000
Header names are not case-sensitive, so strict-transport-security and Strict-Transport-Security are the same header. Over HTTP/2 and HTTP/3 they always travel in lower case. When people say "check the headers" they nearly always mean the response headers, because those are the ones you control on your server.
Check HTTP headers online
- Open the HTTP Headers Parser.
- Enter the URL. If you leave out
https://, it is added for you. - Run the check and read the list.
Our server requests the page without cookies, follows redirects one hop at a time (up to 20) and lists the response headers of every hop in order, so a redirect's Location header appears before the final page's headers. Because the request comes from our server, the answer can differ from what you see at home: some firewalls return 403 to server requests, and some sites vary by country or cookie.
Two related checks help here. The Redirect Checker shows each hop's URL with its status code, and the HTTP Status Code Checker gives the final status in one line.
For a verdict rather than a raw list, use the Security Headers Checker. It grades the page from A to F with a score out of 100, based on six headers: Strict-Transport-Security, Content-Security-Policy, clickjacking protection (X-Frame-Options or CSP frame-ancestors), X-Content-Type-Options, Referrer-Policy and Permissions-Policy. Each one is marked Good, Improve or Missing with an example value to copy. It also flags headers that reveal software versions (such as X-Powered-By), cookies missing the Secure, HttpOnly or SameSite flags, and lists every raw header at the bottom.
Check headers in Chrome DevTools
- Open the page and press F12 (Cmd+Option+I on a Mac).
- Click the Network tab and tick Disable cache.
- Reload the page. DevTools only records requests made while it is open.
- Click the first row, the page itself (type "document").
- In the Headers panel, scroll to Response Headers. Switch on Raw to see them exactly as sent.
Edge is identical and Firefox is nearly the same. This is the only method that shows what your browser received, with your cookies and your location, which makes it the right one for logged-in pages.
Check headers with curl
curl -I sends a HEAD request and prints only the headers. Add -L to follow redirects and -s to hide the progress meter. This is real output for our own site, trimmed:
curl -sI -L http://seopeck.com
HTTP/1.1 301 Moved Permanently
Content-Type: text/html
location: https://seopeck.com/
Server: hcdn
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Vary: Accept-Encoding
Cache-Control: max-age=300, public, s-maxage=1800
content-security-policy: upgrade-insecure-requests
x-content-type-options: nosniff
referrer-policy: strict-origin-when-cross-origin
strict-transport-security: max-age=31536000
Age: 1156
x-hcdn-cache-status: HIT
The first block is the 301 from HTTP to HTTPS; the second is the final page. Cache-Control lets browsers keep it for 5 minutes and the CDN for 30, and Age plus HIT show the copy came from the CDN cache. On the security side the page has HSTS, nosniff and a Referrer-Policy, but its CSP only upgrades insecure requests and there is no frame-ancestors or Permissions-Policy. That is exactly the kind of gap a header check finds.
Three practical notes:
- Some servers answer HEAD differently from GET. To see the headers of a normal GET, run
curl -s -D - -o /dev/null https://example.com(use-o NULon Windows). - curl does not ask for compression unless you tell it to. Add
-H "Accept-Encoding: gzip, br"to seeContent-Encoding. - In Windows PowerShell 5.1,
curlis an alias forInvoke-WebRequest. Typecurl.exeinstead; it ships with Windows 10 and 11.
The security headers to look for in 2026
| Header | Good starting value | What it does |
|---|---|---|
| Strict-Transport-Security | max-age=31536000; includeSubDomains | Makes browsers use HTTPS only for the next year, so the first http:// visit cannot be intercepted. |
| Content-Security-Policy | default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self', plus the outside sources you use | Limits which scripts, styles, frames and connections a page may use. The main defence against cross-site scripting. |
CSP frame-ancestors | 'self' or 'none' | Decides who may show your pages in a frame, which stops clickjacking. |
| X-Content-Type-Options | nosniff | Stops the browser guessing file types, so a file served as text cannot run as a script. |
| Referrer-Policy | strict-origin-when-cross-origin | Sends only your domain, not the full URL, to other sites. Modern browsers already default to this; setting it makes it explicit. |
| Permissions-Policy | camera=(), microphone=(), geolocation=() | Switches off browser features you do not use, for your pages and anything embedded in them. |
HSTS is ignored on plain HTTP responses, so it only works once the whole site is on HTTPS (our guide to SSL certificate errors helps if it is not). Add includeSubDomains only when every subdomain serves HTTPS. The preload flag, which builds HSTS into browsers, also needs a one-year max-age and includeSubDomains, and getting off the list again is slow, so treat it as a one-way door.
CSP is the header most likely to break a site, because a strict policy blocks every script it does not list. The CSP Generator starts from a safe base, has presets for Google Analytics and Tag Manager, Google Fonts, AdSense, YouTube embeds and the jsDelivr and cdnjs CDNs, warns about 'unsafe-inline' and wildcards, and prints the policy as a header, an Apache line, an Nginx line and a meta tag. A meta tag cannot carry frame-ancestors, so send that one as a real header.
Headers you no longer need
- X-XSS-Protection: MDN marks it deprecated. Chrome and Edge removed the filter it controlled, Firefox never had one, and the filter itself could be abused. Leave it out and use CSP; if a scanner insists,
X-XSS-Protection: 0is the safe value. - X-Frame-Options: superseded by CSP
frame-ancestors, which is more flexible, and browsers that support both followframe-ancestors. KeepingX-Frame-Options: SAMEORIGINdoes no harm for very old browsers, but it is no longer the main defence. Our checker accepts either. - Expect-CT and Public-Key-Pins: deprecated, and browsers no longer act on them.
- Feature-Policy: renamed to Permissions-Policy, with a different syntax.
Headers that matter for speed and SEO
- Cache-Control: how long browsers and CDNs may reuse a response. Long lifetimes for images, CSS and JS make repeat visits fast.
- Content-Encoding:
gziporbrmeans the response is compressed. Test it with the GZIP Compression Test, and see how gzip compression works. - Vary: Accept-Encoding: tells caches to keep compressed and uncompressed copies apart.
- X-Robots-Tag: a
noindexhere hides a page from Google even when the HTML looks clean. The Noindex Checker looks at both places. - Location: where a redirect goes. Whether it comes with a 301 or a 302 matters; see 301 vs 302 redirects and HTTP status codes explained.
How to add missing headers
Apache or LiteSpeed (.htaccess)
This block passes Apache 2.4's syntax check. It sends CSP in report-only mode first, so nothing breaks while you test:
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
Header always set Content-Security-Policy-Report-Only "default-src 'self'; object-src 'none'; frame-ancestors 'self'; base-uri 'self'"
Header unset X-Powered-By
</IfModule>
Nginx
An example for the server block. The always flag adds the headers to error pages too:
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
add_header Content-Security-Policy-Report-Only "default-src 'self'; object-src 'none'; frame-ancestors 'self'; base-uri 'self'" always;
Watch out: by default, a location block with its own add_header drops all the headers set at the server level. Repeat them there, or keep them in one included file. Reload with nginx -t && systemctl reload nginx.
Cloudflare
Turn on HSTS under SSL/TLS → Edge Certificates. Add the other headers with a response header transform rule (Rules, then create a rule that sets static response headers). Headers your origin server already sends pass through, so do not set the same one in both places.
Common mistakes
- Enforcing a CSP you have not tested. Run it as
Content-Security-Policy-Report-Onlyfor a week, fix what the browser console reports, then switch the header name. - includeSubDomains too early. One forgotten HTTP-only subdomain becomes unreachable for a year.
- Duplicate headers. The app, the server and the CDN each add one. Browsers enforce every CSP they receive, so two policies block more than either alone, and only the first HSTS header counts.
- Headers missing on some responses. Without
always, Apache leaves them off non-2xx responses and Nginx off error pages. - Checking a cached copy. If new headers do not show up, purge the CDN cache and test again with DevTools' cache disabled.
Frequently asked questions
How do I see the HTTP headers of a website?
Paste the URL into an online headers tool, open DevTools (F12, Network, click the page, Response Headers), or run curl -sI -L https://example.com.
Which security headers should every site have?
Strict-Transport-Security, a Content-Security-Policy with frame-ancestors, X-Content-Type-Options: nosniff, Referrer-Policy and Permissions-Policy. Start with the first four; CSP takes the most testing.
Is X-XSS-Protection still needed?
No. It is deprecated, current browsers ignore it, and CSP does the job properly.
Why don't my new headers show up?
Usually a cache (CDN or browser), a config file the server does not read (for example .htaccess on Nginx), or headers that are only added to some responses. Purge, then check with curl.
Do security headers help SEO?
Not directly; Google does not rank pages on them. HTTPS is a light ranking signal, and HSTS keeps visitors on it. Headers like X-Robots-Tag, Cache-Control and Location do affect crawling and speed.
What does a Content-Security-Policy do, and how do I write one safely?
It lists the sources a page may load scripts, styles, images and frames from, and blocks everything else. Build it with a generator, run it in report-only mode, fix the reports, then enforce it.
Next step
Run your homepage through the HTTP Headers Parser to see what it sends today, then grade it with the Security Headers Checker and add the missing headers one at a time, testing after each change.