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.

No sign-up and no email. Results are not published or tied to you.

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

01

Enter your address

Any public site works. We read the homepage and follow its redirects, as our free scan does.

02

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.

03

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.

What each security header needs to pass
HeaderWhat passes
Content-Security-PolicyAn enforced policy. Content-Security-Policy-Report-Only on its own is a warning.
X-Frame-Options or CSP frame-ancestorsDENY or SAMEORIGIN, or a frame-ancestors list with no * and no bare https: or http:.
X-Content-Type-OptionsExactly nosniff.
Strict-Transport-SecurityA max-age of at least 15768000 seconds, six months.
HTTP to HTTPS redirectThe first answer on http:// is a redirect to https:// on the same host.
Referrer-PolicyOne of no-referrer, same-origin, strict-origin, strict-origin-when-cross-origin.
Permissions-PolicySent, naming the features the site does not use.

Source: MDN HTTP Observatory, tests and scoring.

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

01

Which 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.
02

How 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.
03

Why 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.
04

Do 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.
05

Why 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.
06

What 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.
07

Is 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.

One address, 156 checks, each with its fix.

No account, just the address.