Skip to content

Free tool

Security headers checker

Scan a site’s HTTP security headers and get a grade from A+ to F, with what each missing or weak header allows and the exact line to add.

Try

The six headers that matter

  • Strict-Transport-Security (HSTS) tells browsers to use HTTPS only, so nobody on the network can downgrade a visit to HTTP. Use at least six months: max-age=31536000; includeSubDomains.
  • Content-Security-Policy (CSP) lists where scripts, styles and frames may come from. It is the strongest defence against cross-site scripting, if it does not allow 'unsafe-inline' scripts.
  • X-Frame-Options or CSP frame-ancestors stops other sites from framing yours, which prevents clickjacking.
  • X-Content-Type-Options: nosniff stops browsers from guessing that an uploaded file is a script.
  • Referrer-Policy controls how much of your URLs other sites receive; strict-origin-when-cross-origin is a good default.
  • Permissions-Policy turns off camera, microphone, location and other features for the page and its frames.

How the grade works

Each of the six headers scores a full point when set correctly, half a point when present but weak (a short HSTS, a CSP that still allows inline scripts, a referrer policy that leaks full URLs), and nothing when missing. Six points is an A; A+ also needs HSTS preload and no version numbers in Server or X-Powered-By. The checker also lists cookies without Secure, HttpOnly or SameSite.

The grade is a starting point, not a pen test: a perfect header set does not fix an injectable form, and a strict CSP needs testing so it does not break the site.

Rolling out CSP safely

Start with Content-Security-Policy-Report-Only and a report endpoint, watch what would be blocked for a week, then switch to enforcing. Replace inline scripts with nonces or hashes instead of allowing 'unsafe-inline'. Most frameworks (Next.js, Rails, Django) can add a nonce per request.

Set headers once at the edge (CDN, nginx, load balancer) so every response, including error pages and redirects, carries them. Then check again with this tool and the HTTP headers checker.

Frequently asked questions

What is a good security headers grade?

A or A+. Most sites start at D or F because only one or two headers are set by default; adding the six headers takes a few lines in the web server or CDN configuration.

Is X-XSS-Protection still needed?

No. Modern browsers removed the XSS auditor it controlled. Use a Content-Security-Policy instead and leave X-XSS-Protection out (or set it to 0).

Will HSTS break my site?

Only if parts of it do not work over HTTPS. Start with a short max-age (a day), confirm everything works, then raise it. Preload is hard to undo, so add it last.

Does this check my whole site?

It checks the final response of the URL you enter. Headers can differ between pages, so check your main templates: home, login, an article and an API endpoint.

More free tools

All tools