Security headers checker

Short answer

Which security headers should a website have?

A website should at least have the security headers Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options: nosniff, Referrer-Policy and protection against framing with frame-ancestors or X-Frame-Options. The headers are sent by the web server with every page and protect visitors against clickjacking and injected scripts, among other things. Enter the domain to see which are missing.

Enter the domain and we fetch the front page and read the headers.

Why the headers matter

The security headers protect visitors against clickjacking, script injection and downgrade to http, among other things. They cost little to add.

Example values

  • Strict-Transport-Security: max-age=31536000; includeSubDomains
  • Content-Security-Policy: default-src 'self'; frame-ancestors 'self'
  • X-Content-Type-Options: nosniff
  • Referrer-Policy: strict-origin-when-cross-origin
  • Permissions-Policy: camera=(), microphone=(), geolocation=()

How to add them

The headers are set in the web server or in front of it: in the Apache, nginx or IIS configuration, in a WordPress plugin, or as a rule at Cloudflare or another CDN. Start with the simple headers, and test Content-Security-Policy with Content-Security-Policy-Report-Only first, so you do not stop scripts the website needs.

Questions and answers

Which header matters most?

Strict-Transport-Security and a strict Content-Security-Policy give the most protection.

Do I need X-XSS-Protection?

No. Modern browsers have removed the feature. Use Content-Security-Policy instead.

Why do you only check the front page?

The front page usually shows what the server sends for the whole website. Headers set in an application can vary between pages, so test important pages like the sign-in page too.

Can security headers break the website?

Yes, a too strict Content-Security-Policy can stop scripts, fonts, maps or forms from other services. Test in Report-Only first and read what the browser reports in the console.

Do the security headers affect search engines?

Not directly. Google does not rank by security headers, but https is a ranking signal, and a website that gets hacked can be flagged as dangerous in the search results.