Security Headers Checker
Grade any site's HTTP security headers and see exactly what to add.
Enter a URL to see which HTTP security headers a site sends, what each one protects against, and a letter grade weighted by how much protection each header actually provides.
Where a header is missing, you get the exact line to add — and where one is present but weak, an explanation of why it is not doing the job you might assume.
How it works
Security headers are instructions a server sends telling the browser to enforce restrictions on its own. They cost nothing to add, need no code changes, and shut down entire classes of attack — which is why their absence is such a common finding.
Weighted by what they actually prevent:
- Content-Security-Policy controls which sources may load
scripts, styles and frames. It is the single most effective defence against
cross-site scripting, and also the hardest to deploy — a policy containing
unsafe-inlinefor scripts gives away most of the benefit, which is why we flag it rather than just noting the header exists. - Strict-Transport-Security forces HTTPS for future visits. Without it, a visitor's first request can still go over plain HTTP and be intercepted, even on a site that redirects.
- X-Content-Type-Options: nosniff stops browsers guessing a file's type. Without it, an uploaded file that looks like script can be executed as script.
- X-Frame-Options (or CSP's
frame-ancestors) prevents your pages being embedded in someone else's, which is how clickjacking works. - Referrer-Policy limits how much of your URL is leaked to other sites — relevant when URLs contain tokens or identifiers.
Two headers you may expect are deliberately not scored.
X-XSS-Protection is obsolete and removed from modern browsers; it
could itself introduce vulnerabilities, and the correct value today is
0. Expect-CT is likewise retired, since Certificate
Transparency is now enforced by default.
Frequently asked questions
Which header should I add first?
Strict-Transport-Security, X-Content-Type-Options and X-Frame-Options take minutes and carry no risk of breaking a site. Content-Security-Policy is the most valuable but needs care — deploy it in report-only mode first, watch what it would have blocked, then enforce.
Why does my CSP score poorly when I have one?
Almost certainly unsafe-inline or unsafe-eval in script-src. Those permit exactly the inline script injection CSP exists to stop, so the policy is present but not protecting much. Use nonces or hashes for inline scripts instead.
Is HSTS risky to enable?
It commits you to HTTPS for the max-age period — browsers will refuse plain HTTP for your domain, and you cannot easily undo it. Start with a short max-age such as 300, confirm nothing breaks, then raise it to a year. Only add preload once you are certain, since removal from the preload list takes months.
Do these headers slow down my site?
No measurably. They add a few hundred bytes per response. A restrictive CSP can block resources you did not realise you depended on, which is why report-only mode exists.
Should I still add X-XSS-Protection?
No. The browser filter it enabled has been removed from Chrome and Edge and never existed in Firefox, and it introduced vulnerabilities of its own. If you set it at all, set it to 0. Content-Security-Policy is the replacement.
Where do I add these headers?
In your web server config — an .htaccess Header directive on Apache or LiteSpeed, add_header on nginx — or in your application framework. Setting them at the server level covers static files that never reach your application code.
Related tools
HTTP Header Checker
See every response header, the full redirect chain, and where the time goes.
Network & IPContent Security Policy (CSP) Generator
Generate strict CSP headers to protect your website from XSS attacks.
SecuritySSL Certificate Checker
Check any site's certificate: expiry, issuer, hostname coverage and chain.
SSL & TLSHSTS Checker
Verify HTTP Strict Transport Security (HSTS) headers and preload status.
SecurityMixed Content Checker
Scan a webpage for insecure HTTP resources loaded over HTTPS.
SSL & TLS.htaccess Generator
Build an .htaccess file for redirects, HTTPS, caching and security.
Server ConfigNeed hosting that just works?
Free SSL, daily backups and 24×7 support on every Loudhost plan.