Xerobit

Security Headers Checker: Grade Your HTTP Response Headers

Paste your HTTP response headers into this security headers checker to receive a letter grade from A to F for each critical header. It evaluates HSTS, Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Permissions-Policy, then lists any missing directives with recommended values. Everything runs locally in your browser so no data is uploaded.

Paste raw headers as returned by curl -I or your browser dev tools.

Result

  • Overall Grade
    A

    Weighted average of the six grades (CSP counts 3, HSTS 2, the others 1). Weakest header: HSTS (A).

  • HSTS
    A

    One year or more, with includeSubDomains and preload.

  • CSP
    A

    No unsafe inline scripts, wildcards or open schemes in script sources.

  • X-Frame-Options
    A

    Frames are completely blocked.

  • X-Content-Type-Options
    A

    MIME sniffing is prevented.

  • Referrer-Policy
    A

    Restrictive referrer policy applied.

  • Permissions-Policy
    A

    Permissions-Policy is present.

This is a simple rubric written for this tool, not the grading used by securityheaders.com or Mozilla Observatory. It reads only the text you paste and does not test the live site.

How to use the security headers checker

  1. Run curl -I https://example.com or open your browser developer tools to the Network tab and copy the response headers.
  2. Paste the raw headers into the text area above.
  3. Review the overall grade and the individual grades for each of the six core security headers.
  4. 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-age of at least 31536000 (one year) with includeSubDomains; preload is 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-src or default-src. D if the script sources (or object sources) contain 'unsafe-inline' without a nonce, hash or 'strict-dynamic', a * wildcard, data:, or a bare https: or http:. B if the only weakness is 'unsafe-eval'. Otherwise A. For a full review use the CSP evaluator.
  • X-Frame-Options: A for DENY or SAMEORIGIN, and also A when the header is missing but CSP has frame-ancestors. C for the obsolete ALLOW-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-origin or strict-origin-when-cross-origin. B for origin. C for no-referrer-when-downgrade, origin-when-cross-origin or a value no browser recognizes. F for unsafe-url or 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.

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

ExampleInputResult
Fully secured siteHTTP 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 headersHTTP response headers: Server: nginx/1.18.0 / X-Content-Type-Options: nosniffOverall Grade: F; HSTS: F; CSP: F; X-Frame-Options: F; X-Content-Type-Options: A; Referrer-Policy: F; Permissions-Policy: F
Weak HSTS onlyHTTP response headers: Strict-Transport-Security: max-age=300Overall 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.