AIO Copilot

Security Headers Analyzer

Paste a page's HTTP response headers to check eight security headers, from Strict-Transport-Security to Content-Security-Policy. Each gets a pass, warning or fail, and the page a letter grade.

How to check your security headers

Copy the headers from one response, paste them, then fix them at the server.

  1. Copy the response headers

    Run curl -I with your URL, or open your browser's developer tools, reload the page, select the main document request in the Network tab and copy its response headers.

  2. Paste and analyze

    Paste one header per line in Name: value form and select Analyze Headers. Header names are matched regardless of case, and the analysis runs in your browser.

  3. Read each header

    Each of the eight headers gets pass, warning or fail with a suggested fix. The letter grade is this tool's own scale, so use it to compare your site before and after a change.

  4. Fix it where headers are set

    Change the header where your responses are produced: the web server, the CDN or your host's header settings. Re-run the check, then scan the live site with Mozilla's HTTP Observatory.

What do HTTP security headers do?

Security headers are instructions a server sends with each response telling the browser to switch on protections: use HTTPS only, refuse to be framed by other sites, load resources only from approved sources, and limit the referrer data and browser features a page exposes. The browser does the enforcing, so the work lies in choosing values that do not break your own pages. OWASP's HTTP Headers Cheat Sheet and MDN's reference pages, linked in the table below, are the two references worth keeping open while you set them.

They are security work more than SEO. When Google began using HTTPS for ranking in 2014 it called it "a very lightweight signal", and its page experience guide asks only "Are your pages served in a secure fashion?" without mentioning headers. The search risk is a compromise. Search Console's Security Issues report covers hacked content, malware and social engineering; flagged pages can carry a warning label in results and an interstitial warning in browsers, and Google says fixing only some pages "will not earn you a partial return to search results." Headers sit at the edge of technical SEO for that reason.

Which headers does this analyzer check?

Eight, each scored pass, warning or fail. The table shows what each header does, per MDN, and the value this tool treats as a pass.

The eight headers this analyzer checks
HeaderWhat it doesWhat earns a pass here
Strict-Transport-SecurityTells the browser to use only HTTPS for this host on future visitsmax-age of at least 31536000 with includeSubDomains
Content-Security-PolicyControls which scripts, styles and other resources the page may loaddefault-src present, no 'unsafe-inline' or 'unsafe-eval'
X-Content-Type-OptionsBlocks scripts and stylesheets served with the wrong MIME typenosniff
X-Frame-OptionsSays whether other pages may show yours in a frame, which blocks clickjackingDENY or SAMEORIGIN, or a CSP frame-ancestors directive if the header is absent
Referrer-PolicyLimits how much of the URL is sent to other sites in the Referer headerno-referrer, same-origin, strict-origin or strict-origin-when-cross-origin
Permissions-PolicyAllows or denies browser features such as camera, microphone and geolocationPresent (Feature-Policy also accepted)
Cross-Origin-Opener-PolicyControls whether documents opened from your page share its browsing context groupsame-origin
X-XSS-ProtectionSwitched on an old filter in Internet Explorer, Chrome and Safari; now deprecatedAbsent, or set to 0

How should I set Strict-Transport-Security?

HSTS tells a browser that a host "should only be accessed using HTTPS", upgrades later HTTP requests automatically, and stops users clicking through certificate errors. Three details matter in practice. Browsers ignore the header if it arrives over plain HTTP. It protects only after a first secure visit, which is why browsers ship a preload list, hosted by Google at hstspreload.org, that requires a max-age of at least 31536000 seconds (one year) plus includeSubDomains. And includeSubDomains blocks any subdomain that only works over HTTP, so audit subdomains first. OWASP's example value is max-age=63072000; includeSubDomains; preload, two years, with the warning "Read carefully how this header works before using it." This analyzer passes a max-age of a year or more with includeSubDomains and does not check preload.

Why does a Content-Security-Policy with unsafe-inline get a warning?

Because MDN says 'unsafe-inline' and 'unsafe-eval' each "defeats much of the purpose of having a CSP": they re-allow inline script and the evaluation of strings as code, which a policy otherwise blocks. The analyzer also wants default-src, which serves as the fallback for the other fetch directives. OWASP calls CSP "complex to configure and maintain", and MDN describes the testing route: send the policy first as Content-Security-Policy-Report-Only, which reports violations without blocking anything, then switch once the reports are clean. The analyzer also reads frame-ancestors, the CSP directive OWASP recommends over X-Frame-Options: when it is set, a missing X-Frame-Options header passes rather than fails.

Which headers are outdated or easy to misread?

X-XSS-Protection is the clearest case. MDN marks it deprecated and warns it "can create XSS vulnerabilities in otherwise safe websites", and OWASP says "do not set this header or explicitly turn it off." The analyzer passes it when absent or set to 0, which turns the filter off, and warns on 1; mode=block or any other value that switches it on. Referrer-Policy is the other. Browsers have defaulted to strict-origin-when-cross-origin since a November 2020 change to the specification, and OWASP still advises setting it explicitly. The analyzer warns on no-referrer-when-downgrade, the old default, because it sends the full URL, path and query string included, to other HTTPS sites.

What this analyzer does not check

It reads the headers you paste from one response. It cannot tell whether every page and file sends them, whether HSTS reaches browsers over HTTPS, or how cookies, CORS and Cross-Origin-Embedder-Policy are set. It ignores the Server and X-Powered-By headers, which OWASP suggests removing or making non-informative. Its grade is its own: 2 points for each pass and 1 for each warning, out of 16, so it will not match the score from Mozilla's HTTP Observatory, which scans a live site and assesses its headers and other security settings. Use this tool to fix a header set quickly, and the Observatory to confirm what the live site sends. For where HTTPS fits among the checks that do affect search, see the HTTPS section of our technical SEO audit checklist.

Security header questions.

Rankings, reading headers, HSTS values, framing, CSP warnings and X-XSS-Protection.

Do security headers affect Google rankings?

Not directly. Google called HTTPS "a very lightweight signal" when it began using it for ranking in 2014, and its page experience guidance does not mention security headers. Their value for search is protective: a hacked site can get a warning label in results and an interstitial warning in browsers, and Google reviews the site only after every affected page is fixed.

How do I see a site's response headers?

Run curl -I followed by the URL, which fetches only the headers. In a browser, open developer tools, reload the page, select the first document request in the Network tab and read its response headers. The URL Inspection live test in Search Console also shows the HTTP headers Google received.

What is a good HSTS value?

max-age=31536000; includeSubDomains, one year, is the minimum the HSTS preload list accepts, and OWASP's cheat sheet gives max-age=63072000; includeSubDomains; preload, two years, as its example. Browsers ignore the header when it arrives over plain HTTP. Before adding includeSubDomains, make sure every subdomain works over HTTPS, because the policy blocks any that do not.

Should I use X-Frame-Options or CSP frame-ancestors?

OWASP recommends the CSP frame-ancestors directive where possible, and MDN describes it as the more complete option. X-Frame-Options with DENY or SAMEORIGIN still works in browsers and costs nothing to send alongside it, but its old ALLOW-FROM value is obsolete. This analyzer accepts either: when X-Frame-Options is missing but the Content-Security-Policy sets frame-ancestors, the X-Frame-Options line passes.

Why does my Content-Security-Policy get a warning?

The analyzer warns when a policy has no default-src, the fallback for the other fetch directives, or contains unsafe-inline or unsafe-eval. MDN says each of those keywords defeats much of the purpose of having a CSP. Test a stricter policy with the Content-Security-Policy-Report-Only header first, which reports violations without blocking anything.

Should I still send X-XSS-Protection?

No. MDN marks the header deprecated and non-standard and warns that it can create cross-site scripting vulnerabilities in otherwise safe sites, and OWASP says not to set it or to turn it off with a value of 0. The analyzer passes a response without it or with a value of 0, and warns on 1 or 1; mode=block.

Want a second opinion on a live URL?

This tool reads headers you paste. Mozilla's HTTP Observatory scans a live site and assesses its HTTP headers and other security settings against Mozilla's guidance, which is a useful cross-check after you deploy changes.

Open HTTP Observatory

What to do next.