Security Headers Checker: Grade HSTS, CSP, and Other HTTP Security Headers

Security headers are instructions your web server sends with every page. They tell the browser to use HTTPS only, which scripts may run, whether another site can frame the page, and how much of your address to share when a visitor clicks away. A missing header rarely breaks anything you can see, so the gap usually surfaces in a scanner report, a security questionnaire, or a customer’s IT review.
Marketers are closer to this than they think. The tags on your site, from a Google Tag Manager container to ad pixels and chat widgets, are third-party code, and the CSP header decides whether that code is allowed to run. Set the headers well and you protect visitors and your brand. Set them carelessly and your GTM tags and analytics can quietly stop firing. This free checker grades the six headers that matter most and gives you copy-ready fixes for Apache, Nginx, and Cloudflare.
Security Headers Checker
Security Headers Checker v1.0.0Last Update: Dec 4, 2026
Enter a web address, then click Check. We request the page, read the security headers it sends, grade each one, and show the fix for anything missing.
Enter a public web address and click Check. The checker requests the page, follows up to five redirects, and grades the headers on the final response. Each header gets a status, a plain-English explanation, and a fix for your server, and the picker defaults to the server it detects. Results are cached for ten minutes, and Check again now runs a fresh request.
What the Checker Grades
The grade is out of 100 points, split across six headers:
- Strict-Transport-Security, 25 points: the HSTS header tells browsers to use HTTPS only. It earns full points with a max-age of at least six months.
- Content-Security-Policy, 25 points: limits where scripts and other resources can load from. Policies that allow
'unsafe-inline'without a nonce or hash,'unsafe-eval', or wildcard script sources earn partial credit. - X-Frame-Options or CSP frame-ancestors, 15 points: controls whether other sites can embed your page, which blocks clickjacking.
- X-Content-Type-Options, 15 points: set to
nosniff, it stops browsers from guessing a file’s MIME type. - Referrer-Policy, 10 points: controls how much of the page address is shared when a visitor clicks a link.
- Permissions-Policy, 10 points: limits which browser features, such as the camera and microphone, the page can use.
How the Grade Works
A header earns full points when it is present and well configured, half when it is present but weak, and none when it is missing or invalid. The total maps to a letter grade: A at 85 points or more, B at 70, C at 55, D at 40, and F below that. An A+ takes all 100 points and no response header that leaks software details, such as a Server value with a version number or X-Powered-By.
| Header | Full points | Half points | No points |
|---|---|---|---|
| Strict-Transport-Security | max-age of six months or more | max-age under six months | Missing, invalid, max-age=0, or the page loads over plain HTTP |
| Content-Security-Policy | Enforced policy that limits scripts and avoids the weak patterns above | Report-only policy, or a policy with weak script rules | Missing |
| Framing protection | X-Frame-Options DENY or SAMEORIGIN, or a CSP frame-ancestors rule | ALLOW-FROM, duplicate headers, or a rule that lets any site frame the page | Neither header is set |
| X-Content-Type-Options | nosniff | Not used | Missing or any other value |
| Referrer-Policy | no-referrer, same-origin, strict-origin, or strict-origin-when-cross-origin | Missing, or a more permissive value | unsafe-url, or no valid value |
| Permissions-Policy | A valid policy is set | Missing, legacy Feature-Policy only, or unreadable syntax | Not used |
The checker also shows the cross-origin headers COOP, CORP, and COEP for reference, but they do not change the grade. If a site sits behind a bot challenge, the checker tells you instead of grading the challenge page, and only public addresses can be checked. Because the grade comes from the final page after redirects, test the exact address your visitors land on. Each host and page template can send different headers, so check your home page, a landing page, your checkout, and any subdomain that runs a different platform.
Why Security Headers Matter to Marketers
Most sites still leave this protection off. In the HTTP Archive’s 2025 Web Almanac, HSTS appeared on 36% of mobile pages and Content-Security-Policy on 21.9%, up from 18.5% a year earlier. Permissions-Policy was set on only 3.7% of mobile sites.
The adoption of CSP continued increasing from 18.5% last year to 21.9% this year, an increase of close to 20%.
HTTP Archive, Web Almanac 2025: Security, January 2026
Low adoption means a clean report is a quiet advantage. Here is why a marketing team should care:
- Trust: security questionnaires and vendor reviews from larger customers can include these headers, so a strong result shortens the conversation.
- Brand protection: a policy that blocks unapproved scripts limits what an attacker or a compromised vendor script can do on your landing pages and checkout, such as skimming form data or redirecting visitors. I cover how those attacks work in Third-Party Script Attacks.
- Search visibility: Google’s page experience guidance points site owners to HTTPS, not to individual security headers, so I would not sell these as a ranking tactic. The SEO benefit is protective: HSTS keeps visits on one secure address, and a site that is not injected with spam or malware keeps the visibility it has earned.
- Measurement: CSP is where marketing and security collide. A policy that blocks your analytics or consent tools breaks reporting, which is why the rollout plan below starts in report-only mode.
HSTS: Keep Every Visit on HTTPS
HSTS tells the browser that a site must only be loaded over HTTPS and that any future http:// request should be upgraded automatically. It also stops visitors from clicking through certificate errors on that host. MDN walks through the scenario it prevents: a visitor on rogue public Wi-Fi opens an HTTP link, and because the browser already remembers the site as HTTPS only, the attacker’s fake server fails the certificate check and the visitor cannot bypass the warning. That is a MITM attack that HSTS shuts down. See MDN’s Strict-Transport-Security reference for the full walkthrough.
The checker recommends max-age=31536000; includeSubDomains, which is one year with subdomains covered. A shorter max-age earns half credit. The header only works when it is sent over HTTPS, because browsers ignore it on plain HTTP, so redirect HTTP to HTTPS first. It also only takes effect after a first secure visit, which is the gap preloading closes.
If your site runs through Cloudflare, you can switch HSTS on in the dashboard. Cloudflare’s HSTS documentation warns that if you remove HTTPS before disabling HSTS, or before the max-age runs out, your site becomes inaccessible to visitors for that period.
Preloading adds your domain to a list built into browsers, so even the first visit is forced to HTTPS. The requirements are a max-age of at least one year, includeSubDomains, and the preload directive, and the rule applies to every subdomain, including internal ones. A forgotten HTTP-only subdomain, such as an old campaign microsite or a vendor-hosted page on your domain, would stop loading. The checker does not require preload for any points, so treat it as a deliberate, optional step.
Don’t request inclusion unless you’re sure that you can support HTTPS for your entire site and all its subdomains in the long term.
hstspreload.org, Removal
Removal is possible, but the same site notes it takes months for a change to reach users through browser updates. That is why preload belongs at the end of the rollout, not the start.
CSP: Control Which Scripts and Resources Load
Content-Security-Policy is the most powerful header on the list and the one most likely to cause trouble, because it governs everything your page loads.
The primary use case for CSP is to control which resources, in particular JavaScript resources, a document is allowed to load. This is mainly used as a defense against cross-site scripting (XSS) attacks, in which an attacker is able to inject malicious code into the victim’s site.
MDN Web Docs, Content Security Policy (CSP)
A policy is a list of approved sources for each type of resource, such as script-src for scripts, img-src for images, connect-src for requests your scripts make, and frame-src for iframes you embed. The checker flags the patterns that let an injected XSS script run anyway: 'unsafe-inline' with no nonce or hash, 'unsafe-eval', and wildcard sources such as *, https:, or data: in the script rules.
The recommended alternative to unsafe-inline is a nonce, a random value your server generates for every response and places in both the header and each script tag. MDN calls nonces the recommended approach for restricting scripts and styles. Because the value changes on every response, the page cannot be fully static HTML. A hash-based policy suits static pages, since the hashes do not change.
A policy can also do two jobs beyond scripts. The frame-ancestors directive controls who can embed your page, and upgrade-insecure-requests rewrites HTTP subresource requests to HTTPS. The checker’s starter policy uses both.
CSP, Tag Manager, and Third-Party Pixels
This is where most CSP projects stall in marketing. A Google Tag Manager container is inline JavaScript that loads gtm.js, so the policy has to allow it. Google’s guide to Tag Manager and CSP recommends a nonce on that inline snippet, with a hash as another option and 'unsafe-inline' as a discouraged last resort.
Tag Manager will then propagate the nonce to any scripts that it adds to the page.
Google for Developers, Use Tag Manager with a Content Security Policy, updated November 10, 2026
That convenience has a side effect worth knowing: scripts added inside the container receive the nonce, so CSP will not stop a tag someone publishes there. Limit who can publish container changes. Google lists other things that break or need extra directives under a policy:
- Custom JavaScript variables evaluate to undefined unless the policy allows
'unsafe-eval'. Google recommends custom templates as the alternative. - Preview mode needs extra Tag Manager and Google hosts allowed for scripts, styles, images, and fonts.
- Every tag you add has its own list of required origins. Google publishes them for Google Analytics, Google Ads, Floodlight, Merchant Center, and server-side tagging, and other vendors’ pixels each need theirs.
Here is a report-only policy for a site that uses Tag Manager with GA4 and no Google Ads features, built from the directives in Google’s guide. Replace the nonce placeholder with a value your server generates per response, and add your own sources before you enforce it.
Content-Security-Policy-Report-Only: default-src 'self'; script-src-elem 'self' 'nonce-{SERVER-GENERATED-NONCE}' https://www.googletagmanager.com; img-src 'self' https://www.googletagmanager.com https://*.google-analytics.com; connect-src 'self' https://www.googletagmanager.com https://*.google-analytics.com https://*.google.com; frame-ancestors 'self'When a policy blocks something, Google’s Tag Assistant lists the blocked resources under page issues, so you can add what is legitimate and leave out what is not. Report-only mode lets you do that before anything breaks.
X-Frame-Options and frame-ancestors: Who Can Embed Your Pages
Framing controls stop other sites from loading your page inside an iframe, the setup behind clickjacking, where a visitor is tricked into clicking something hidden. MDN notes that X-Frame-Options also guards against some cross-site leaks. The frame-ancestors directive in a CSP is the more flexible replacement, and OWASP says it obsoletes X-Frame-Options in browsers that support it. The checker accepts either and gives frame-ancestors priority when both are present.
The old header takes DENY, which blocks all framing, or SAMEORIGIN, which allows only your own site. ALLOW-FROM is obsolete and modern browsers ignore it, so use frame-ancestors with an explicit list when you need to allow specific partners. It also has to be sent as a real header, because MDN states that setting X-Frame-Options in a meta tag has no effect. In the Web Almanac data, sites that send the header mostly choose SAMEORIGIN (72.1%) over DENY (24.6%).
Marketers run into this in two directions. If your landing pages are embedded in a partner portal, a webinar platform, or a page preview tool, a blanket DENY will break the embed, so list those hosts in frame-ancestors instead of dropping the protection. And these headers control who frames you, not what you embed. Putting a YouTube video, a form, or a scheduler on your page is governed by frame-src in your CSP.
X-Content-Type-Options: Stop File Type Guessing
With nosniff set, the browser trusts the declared file type instead of guessing. MDN explains that scripts and stylesheets are blocked when their type does not match, and that browsers will not treat a plain-text response as HTML. That closes a route for attacks in which user-uploaded content gets executed as a page. It is the least risky header to add, and the Web Almanac found it on nearly 50 percent of mobile pages, more than any other security header.
The one thing to check first is that your files carry the right type. A script served as text/plain by a storage bucket or file host will be blocked once nosniff is on, so test marketing assets and tag files that load from outside your main server.
Referrer-Policy: Share Less Without Breaking Attribution
When a visitor clicks a link or your page loads a resource, the browser can tell the destination where the request came from. Referrer-Policy sets how much of your address that includes. Per MDN, strict-origin-when-cross-origin is the default when no policy is set, so current browsers already behave this way, but older ones may send the full address, including the query string. Setting it explicitly makes the behavior consistent.
The marketing effect is mostly good news. With strict-origin-when-cross-origin, other sites see only your domain on a cross-origin click, never your path or query string, so tracking parameters and tokens in your URLs stay private. Your own analytics still get the full address on same-origin navigation. Stricter values change attribution: no-referrer and same-origin stop partner and affiliate sites from seeing your domain as the source of a click, which can break referral reporting on their side. The checker passes those values, so choose them on purpose. At the other end, unsafe-url sends full addresses everywhere, even over HTTP, and fails the check.
Permissions-Policy: Turn Off Features You Do Not Use
Permissions-Policy lets a page switch off browser features such as the camera, microphone, geolocation, and payment, for itself and for anything it embeds. Features are open by default, so a feature stays available until you name it. Adoption is low, 3.7% of mobile sites in the Web Almanac, and MDN currently lists the header as not Baseline, so browser support is uneven. The cost of setting it is small, though, and it limits what an injected script or an embedded widget can ask for.
The checker’s starter value is camera=(), microphone=(), geolocation=(), payment=(), usb=(). Adjust it for your site. A store locator needs geolocation for your own pages, so use geolocation=(self), and a site that uses the browser payment API should not disable payment. The checker accepts any valid policy, but the older Feature-Policy header and its syntax do not count.
How to Roll Out Security Headers Safely
Adding every header at once is how a Friday change turns into a broken checkout. This order moves from the least risky to the most:
- Take inventory. Run the checker on every host you serve, and list the tags, embeds, and vendors your pages depend on: tag manager, analytics, chat, forms, video, and payments.
- Start with the low-risk headers. Add
X-Content-Type-Options,Referrer-Policy, andPermissions-Policy, then check that your marketing files and embeds still work. - Decide who may embed you. Set
X-Frame-Optionsorframe-ancestors, and name any partner or tool that legitimately frames your pages. - Send CSP in report-only mode first. Use
Content-Security-Policy-Report-Only, review the violations, add the sources you actually need, and then switch the header name toContent-Security-Policy. MDN describes report-only as a policy that is not enforced but sends violations to a reporting endpoint. The checker gives half credit for report-only until you enforce it. - Ramp HSTS in stages. hstspreload.org suggests max-age values of 300 seconds, one week, and one month, with
includeSubDomains, waiting out each stage while you watch for broken pages, before moving to a year. Check every subdomain over HTTPS first. - Re-test and keep watching. Run the checker again after any change to your server, CDN, theme, or tag setup, since a new platform or proxy can add, remove, or duplicate headers.
Two of my other free tools help with this work. The SSL Certificate and Security Contact Checker confirms the certificate chain that HSTS depends on, and the Cookie Consent Scanner checks Referrer-Policy and Permissions-Policy alongside consent and tracker issues.
Copy-Ready Config Examples
Headers can be set at your origin server, at your CDN or edge, or both. The checker shows the fix for each missing or weak header in all three formats, and the examples below combine the usual set. The Content-Security-Policy line is the checker’s report-only starter. It allows only your own domain, so add the sources your tags need before you enforce it.

Apache needs mod_headers. Put these in your .htaccess file or the VirtualHost. The always keyword sends the header on error responses too.
<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 X-Frame-Options "SAMEORIGIN"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()"
Header always set Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'; upgrade-insecure-requests"
</IfModule>Nginx uses add_header in the server block. The nginx documentation says these directives are inherited from the previous level only if the current level has no add_header of its own, so a location block that sets one cache or CORS header will silently drop all of these. Version 1.29.3 added add_header_inherit, which can change that behavior.
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()" always;
add_header Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'; upgrade-insecure-requests" always;Cloudflare sets headers at the edge without touching your origin. Create one Response Header Transform Rule per header. Cloudflare’s documentation notes that the rule changes the response sent to visitors, and that rules run in order, so later rules can overwrite earlier ones. Each rule uses these fields:
Rules > Transform Rules > Response Header Transform Rules
Operation: Set static
Header name: X-Content-Type-Options
Value: nosniffRepeat the rule for Referrer-Policy, Permissions-Policy, X-Frame-Options, and the CSP header. For HSTS, use the dedicated setting under SSL/TLS, Edge Certificates, rather than a transform rule. Cloudflare also offers an Add security headers managed transform, but it sends referrer-policy: same-origin, which strips your domain from outbound referrers, plus the deprecated X-XSS-Protection and Expect-CT headers. Cloudflare warns that it can block resources, so review what it adds before you turn it on.
Common Mistakes the Checker Catches
- Headers dropped by a location block. In Nginx, one
add_headerinside alocationblock replaces the inherited set. Test the pages that live under those blocks, not just the home page. - The same header set twice. When an application and a proxy both send a header, the response carries both copies, possibly with conflicting values. OWASP’s guidance is to set each header in one layer only. The checker warns on duplicate framing headers.
- Headers placed in a meta tag. The Web Almanac found that about 0.11% of mobile sites tried to set policies in a meta tag that browsers do not allow there, most often X-Frame-Options, X-Content-Type-Options, and Permissions-Policy. Browsers ignore them, and a report-only CSP cannot be delivered this way either.
- Version leaks. The Web Almanac found a
Serverheader on 91.5% of hosts andX-Powered-Byon 23.9%. A version number tells attackers which known flaws to try, and it keeps an otherwise perfect site from an A+. Cloudflare’s Remove X-Powered-By headers managed transform is a quick fix for that one. - Copying retired headers. X-XSS-Protection is deprecated, and current browsers ignore it. The checker shows it for information only and suggests removing it. Rely on CSP instead.
Key Takeaways
- The checker grades HSTS, CSP, framing protection, X-Content-Type-Options, Referrer-Policy, and Permissions-Policy out of 100 points, using the headers on the final page after up to five redirects.
- Most sites are exposed. The 2025 Web Almanac found HSTS on 36% of mobile pages and CSP on 21.9%, so a strong grade sets you apart.
- CSP is the header that touches marketing. Use a nonce for your Tag Manager snippet, limit who can publish container changes, and run the policy in report-only mode before you enforce it.
- Roll out from low risk to high: nosniff, Referrer-Policy, and Permissions-Policy first, then framing rules, then CSP, then HSTS in stages. Treat HSTS preload as a deliberate last step.
- Set each header in one place, keep it out of meta tags, and remove version-leaking headers such as Server versions and X-Powered-By to reach an A+.
Grade Your Security Headers They are response headers your server sends with a page to tell the browser how to handle it. They control whether the page must use HTTPS, which scripts and resources may load, whether other sites can frame the page, how much referrer information is shared, and which browser features the page can use. At a minimum, Strict-Transport-Security, Content-Security-Policy, X-Frame-Options or the CSP frame-ancestors directive, X-Content-Type-Options, Referrer-Policy, and Permissions-Policy. Those are the six this checker grades. It scores 100 points across the six headers: HSTS 25, CSP 25, framing protection 15, X-Content-Type-Options 15, Referrer-Policy 10, and Permissions-Policy 10. A header earns full points when it is well configured, half when it is present but weak, and none when it is missing or invalid. A is 85 or more, and an A+ also requires that no version-leaking header is sent. It can if the policy does not allow them. Google recommends a nonce on the Tag Manager snippet, plus allowing its hosts for scripts, images, and connections. Custom JavaScript variables need unsafe-eval unless you switch to custom templates. Start with Content-Security-Policy-Report-Only so you can see what would be blocked before you enforce anything. Use frame-ancestors if you can, because it supports an allowlist of specific sites and replaces the older header in browsers that support it. X-Frame-Options with DENY or SAMEORIGIN still works as a simple fallback. Do not use ALLOW-FROM, which modern browsers ignore. Only if every subdomain you own will support HTTPS for the long term. Preload needs a max-age of at least one year, includeSubDomains, and the preload directive, and removal can take months to reach users. Ramp max-age in stages first, and treat preload as optional. Google’s page experience guidance points to HTTPS rather than to individual security headers, so they are not a known ranking tactic. They help protect your site from injected scripts and spam, which protects the visibility you already have. An A+ needs all 100 points and no response header that leaks software details. A Server header with a version number, X-Powered-By, X-AspNet-Version, or X-Generator will hold the grade at an A. Remove those at your server or CDN and run the check again.Frequently Asked Questions
What Are HTTP Security Headers?
Which Security Headers Should Every Website Have?
How Does the Checker Calculate the Grade?
Will a Content Security Policy Break Google Tag Manager or Google Analytics?
Should I Use X-Frame-Options or CSP frame-ancestors?
Is It Safe to Add HSTS Preload?
Do Security Headers Affect SEO?
Why Do I Not Get an A+ After Adding All Six Headers?







