Free tool
Security headers checker
Security headers tell a browser which scripts to run, who may frame your pages and to stay on HTTPS. Enter your address: we read the headers your homepage sends and grade each one the way our free scan does.
Example result
- PassContent-Security-Policy
- FailFrame protection
- PassX-Content-Type-Options
- CheckStrict-Transport-Security
- PassHTTP to HTTPS redirect
Your result shows up here
Each security header your homepage sends, what it does, and whether plain HTTP redirects to HTTPS, graded the way our free scan grades it.
How it works
Three steps, about ten seconds
Enter your address
Any public site works. We read the homepage and follow its redirects, as our free scan does.
We read the headers
We note each security header on the response, then ask for the plain HTTP address to see where it sends visitors.
We grade each one
Each header gets the verdict our free scan gives it, with the fix when it falls short.
Reference
What passes, header by header
These are the lines our free scan draws, and this tool reads them from the same code.
| Header | What passes |
|---|---|
| Content-Security-Policy | An enforced policy. Content-Security-Policy-Report-Only on its own is a warning. |
| X-Frame-Options or CSP frame-ancestors | DENY or SAMEORIGIN, or a frame-ancestors list with no * and no bare https: or http:. |
| X-Content-Type-Options | Exactly nosniff. |
| Strict-Transport-Security | A max-age of at least 15768000 seconds, six months. |
| HTTP to HTTPS redirect | The first answer on http:// is a redirect to https:// on the same host. |
| Referrer-Policy | One of no-referrer, same-origin, strict-origin, strict-origin-when-cross-origin. |
| Permissions-Policy | Sent, naming the features the site does not use. |
Fix it on your platform
Send the headers on your platform
Each header is a line of config. Write your Content-Security-Policy for your own scripts: send it as Content-Security-Policy-Report-Only first, read what it would block, then switch the name.
Next.js
Add a headers() function to next.config.ts:
async headers() {
return [
{
source: "/(.*)",
headers: [
{ key: "Strict-Transport-Security", value: "max-age=63072000; includeSubDomains" },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
],
},
];
},Netlify
Put a _headers file in the folder you publish:
/*
Strict-Transport-Security: max-age=63072000; includeSubDomains
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()Nginx
Send the headers from the HTTPS server block, and redirect port 80 to the same host:
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
server {
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}An add_header inside a location block drops the ones set above it, so repeat them there.
Cloudflare
Under SSL/TLS, Edge Certificates, turn on Always Use HTTPS for the redirect and enable HSTS on the same page. Add the other headers with a response header Transform Rule.
Questions, answered
Security headers, in plain terms
01Which security headers should a website send?
- Content-Security-Policy, Strict-Transport-Security, X-Frame-Options or a CSP frame-ancestors directive, X-Content-Type-Options: nosniff, Referrer-Policy and Permissions-Policy.
- Plain HTTP should also redirect to HTTPS on the same host, before anything else.
02How do I see my headers from a terminal?
- Run curl -sI https://example.com. It prints the response headers and nothing else. Add -L to follow redirects to the page visitors land on.
03Why is Content-Security-Policy-Report-Only not enough?
- A report-only policy tells the browser to report what it would block, and to block nothing. It is the right way to test a policy before you enforce it.
- Once the reports are clean, send the same policy as Content-Security-Policy.
04Do I need X-Frame-Options if I set frame-ancestors?
- Browsers that support CSP use frame-ancestors and ignore X-Frame-Options when both are sent. Sending both also covers older browsers.
05Why is a short HSTS max-age a warning?
- HSTS tells browsers to use HTTPS for as long as max-age says. Mozilla's HTTP Observatory deducts points below six months (15768000 seconds), and our scan draws the line in the same place.
- Two years, max-age=63072000, is the common value.
06What does this check not cover?
- It reads your homepage only. Other pages, API responses and error pages can send different headers.
- It does not judge what your Content-Security-Policy allows, only whether one is enforced.
07Is it free, and do you keep my results?
- It is free and needs no account.
- A result stays in memory for a few minutes so a repeat check does not hit your site again, then it is gone. Nothing is saved to a database or published.
More free tools
- AI crawler checkerWhich AI crawlers your robots.txt lets in, and what each one gets when it asks for your page.
- ChatGPT search checkerWhether OAI-SearchBot and Bingbot can reach your page, and whether the page lets them show it.
- llms.txt validatorChecks your /llms.txt against the llmstxt.org format, or drafts one from your homepage and sitemap.
- Indexability checkerStatus, redirects, canonical, robots meta, X-Robots-Tag and robots.txt for one URL, as Googlebot reads it.
- Meta tag checkerYour title and meta description as a results page prints them, with the lengths that get cut.
- Open Graph previewYour og: and twitter: tags, the image they point at, and how the link card looks in five apps.
- robots.txt checkerWhether robots.txt lets Googlebot, GPTBot or any crawler fetch one URL, and the line that decides it.
- SSL checkerWhether browsers trust your certificate, who issued it, the names on it and how many days it has left.
- Email authentication checkerYour domain's SPF, DKIM and DMARC records, read from DNS, and what each one tells a receiving inbox.