How to use the security headers checker
- Run
curl -I https://example.comor open your browser developer tools to the Network tab and copy the response headers. - Paste the raw headers into the text area above.
- Review the overall grade and the individual grades for each of the six core security headers.
- Read the note beside each grade to see what is missing or misconfigured and what value to apply.
How the grading works
This security headers checker assigns a letter grade from A to F to each of six headers, then combines them into an overall grade. The overall grade is a weighted average of the six grades (A = 4 points down to F = 0): Content-Security-Policy counts three times, Strict-Transport-Security twice and the other four once. The result row also names your weakest header. This is a simple rubric written for this tool, not the scoring used by securityheaders.com or Mozilla Observatory, so the letters will not always match theirs.
- HSTS: A for a
max-ageof at least 31536000 (one year) withincludeSubDomains;preloadis noted but not required. B without includeSubDomains, C for at least six months, D for a shorter positive max-age, F if missing or zero. - CSP: F if missing. C if there is no
script-srcordefault-src. D if the script sources (or object sources) contain'unsafe-inline'without a nonce, hash or'strict-dynamic', a*wildcard,data:, or a barehttps:orhttp:. B if the only weakness is'unsafe-eval'. Otherwise A. For a full review use the CSP evaluator. - X-Frame-Options: A for
DENYorSAMEORIGIN, and also A when the header is missing but CSP hasframe-ancestors. C for the obsoleteALLOW-FROM. F if missing without frame-ancestors, or invalid. - X-Content-Type-Options: A when the value is exactly
nosniff, otherwise F. - Referrer-Policy: A for
no-referrer,same-origin,strict-originorstrict-origin-when-cross-origin. B fororigin. C forno-referrer-when-downgrade,origin-when-cross-originor a value no browser recognizes. F forunsafe-urlor a missing header. In a comma-separated list the last recognized value is used, as browsers do. - Permissions-Policy: A when it looks like a valid policy such as
geolocation=(), C if it is present but malformed, F if missing.
Reference table of recommended values
The following table shows the ideal configuration for each header when aiming for an A grade.
| Header | Recommended Value |
|---|---|
| Strict-Transport-Security | max-age=63072000; includeSubDomains; preload |
| Content-Security-Policy | default-src 'self'; script-src 'self' |
| X-Frame-Options | DENY |
| X-Content-Type-Options | nosniff |
| Referrer-Policy | strict-origin-when-cross-origin |
| Permissions-Policy | geolocation=(), camera=(), microphone=() |
If you need help building a policy from scratch, use the content security policy generator or the hsts checker tool to verify your HSTS setup.
Why these six headers matter
HTTP response headers instruct the browser on how to handle content and connections. Without them, browsers fall back to permissive defaults that leave users vulnerable to cross-site scripting, clickjacking and protocol downgrade attacks.
HSTS forces the browser to always use HTTPS, preventing man-in-the-middle downgrades. CSP restricts where scripts and resources can load from, neutralizing many injection attacks. X-Frame-Options stops other sites from embedding your pages in iframes, blocking clickjacking. X-Content-Type-Options prevents MIME-type sniffing, which can lead to executing malicious files disguised as harmless types. Referrer-Policy controls how much URL information leaks to third parties, and Permissions-Policy disables access to sensitive browser APIs like the camera or geolocation by default.
Common mistakes and edge cases
A frequent error is setting a very short HSTS max-age during testing and forgetting to increase it before production. Browsers cache the HSTS policy, but a short duration leaves a large window for downgrade attacks.
Another issue is deploying a CSP that includes 'unsafe-inline' to quickly fix broken JavaScript. While this stops the page from breaking, it completely defeats the purpose of the CSP against cross-site scripting. Instead, migrate inline scripts to external files or use nonces and hashes.
Finally, some servers send duplicate headers instead of combining them. For example, sending two X-Frame-Options headers may cause browsers to ignore both. Always ensure your server merges directives into a single comma-separated value where applicable.
The checker reads only the headers you paste. It does not fetch your site, so it cannot see headers added by a CDN or a different path, and it does not test whether your policy breaks anything in a browser.
Extracting headers for analysis
To get the raw headers needed for this security headers checker, you can use command-line tools or browser features. With cURL, run curl -sI https://yourdomain.com to fetch only the headers without the body. In Chrome or Firefox, open Developer Tools, navigate to the Network tab, reload the page, click the main document request and view the Response Headers section.
Copy everything from that section and paste it directly into the input field. You do not need to strip out status lines like HTTP/2 200; the parser ignores lines that do not contain a colon separator. If you are auditing general formatting rather than security specifically, a standard http headers checker might also be useful.
Worked examples
| Example | Input | Result |
|---|---|---|
| Fully secured site | HTTP response headers: Strict-Transport-Security: max-age=63072000; includeSubDomains; preload / Content-Security-Policy: default-src 'self' / X-Frame-Options: DENY / X-Content-Type-Options: nosniff / Referrer-Policy: strict-origin-when-cross-origin / Permissions-Policy: geolocation=(), camera=() | Overall Grade: A; HSTS: A; CSP: A; X-Frame-Options: A; X-Content-Type-Options: A; Referrer-Policy: A; Permissions-Policy: A |
| Missing most headers | HTTP response headers: Server: nginx/1.18.0 / X-Content-Type-Options: nosniff | Overall Grade: F; HSTS: F; CSP: F; X-Frame-Options: F; X-Content-Type-Options: A; Referrer-Policy: F; Permissions-Policy: F |
| Weak HSTS only | HTTP response headers: Strict-Transport-Security: max-age=300 | Overall Grade: F; HSTS: D; CSP: F; X-Frame-Options: F; X-Content-Type-Options: F; Referrer-Policy: F; Permissions-Policy: F |
FAQ
What is a security headers checker?
It is a tool that analyzes HTTP response headers to determine if essential security directives are present and correctly configured. It assigns grades to help you identify vulnerabilities.
Does this tool make network requests to my server?
No. You must provide the headers manually by pasting them into the text area. All processing happens locally in your browser, meaning nothing is uploaded to any server.
What is the minimum HSTS max-age for an A grade?
For an A grade the Strict-Transport-Security header needs a max-age of at least 31536000 seconds (one year) and includeSubDomains. The preload directive is not required for the grade, but you need it, with a 31536000 max-age and includeSubDomains, to submit the domain to the preload list.
Can I get an A grade without a Content-Security-Policy?
Not normally. A missing CSP scores F, and because CSP counts three times in the weighted average, even perfect scores on the other five headers leave the overall grade at B. Add a policy, even a basic one, to move higher.
Is X-Frame-Options still necessary if I have a CSP frame-ancestors directive?
Not if your CSP already has a frame-ancestors directive: this checker then gives the X-Frame-Options row an A even when the header is absent. Older browsers only understand X-Frame-Options, so some sites send both.
What happens if I set Referrer-Policy to unsafe-url?
The checker assigns an F for that header. The unsafe-url policy sends the full URL, including query parameters, to any destination, which can leak sensitive tokens or session identifiers.
How is the overall grade calculated?
It is a weighted average of the six header grades: CSP counts three times, HSTS twice and each other header once. The result note also names the weakest header. The rubric is specific to this tool and is not the one used by other header scanners.