Security Headers Grader

Paste raw HTTP response headers and get an A–F grade for CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP / COEP / CORP and information disclosure — each with what's wrong and a concrete value to deploy. Pasted headers are graded entirely in your browser and never uploaded. The optional URL fetch sends only the URL to a server route that requests it and returns the response headers; nothing is stored.

e.g. output of curl -sI https://example.com or DevTools → Network → Response Headers
Samples:

Server-side GET (follows up to 5 redirects, public hosts only). Real browsers may receive different headers than this server-side request.

Paste headers or load a sample above to see a grade.

Header reference

Content-Security-Policy

Content-Security-Policy tells the browser which sources it may load scripts, styles, images, frames and more from. A strict policy is the strongest defence against cross-site scripting (XSS) and data injection. Avoid 'unsafe-inline', 'unsafe-eval' and wildcard sources in script-src.

Strict-Transport-Security

Strict-Transport-Security forces browsers to use HTTPS for your domain for max-age seconds, defeating SSL-stripping and downgrade attacks. Add includeSubDomains to cover every subdomain, and preload to be baked into browsers' built-in HSTS lists (hstspreload.org).

X-Frame-Options

X-Frame-Options stops other sites from embedding your pages in a frame (clickjacking). DENY blocks all framing, SAMEORIGIN allows only your own origin. The modern equivalent is CSP frame-ancestors; sending both is fine.

X-Content-Type-Options

X-Content-Type-Options: nosniff stops browsers from MIME-sniffing a response away from its declared Content-Type, preventing e.g. an uploaded text file from being executed as script.

Referrer-Policy

Referrer-Policy controls how much of the page URL is sent in the Referer header to other sites. URLs can leak tokens, IDs and internal paths. strict-origin-when-cross-origin is the sensible default; no-referrer is the strictest.

Permissions-Policy

Permissions-Policy (formerly Feature-Policy) lets you switch off powerful browser features — camera, microphone, geolocation, payment, USB — for your page and any embedded frames, limiting the damage of an XSS or a malicious third-party iframe.

Cross-Origin-Opener-Policy

Cross-Origin-Opener-Policy isolates your browsing context group from cross-origin windows opened via window.open, defending against XS-Leaks and Spectre-style side channels. same-origin is the strongest value; required (with COEP) for cross-origin isolation.

Cross-Origin-Embedder-Policy

Cross-Origin-Embedder-Policy requires every cross-origin subresource to explicitly opt in (via CORP or CORS). Together with COOP: same-origin it enables cross-origin isolation (SharedArrayBuffer, high-res timers). Roll out carefully: it can break third-party embeds.

Cross-Origin-Resource-Policy

Cross-Origin-Resource-Policy tells browsers which origins may load this resource, blocking cross-origin no-cors reads (a Spectre / data-leak mitigation). Use same-origin for private content and cross-origin only for deliberately public assets (CDN images, fonts).

Server / X-Powered-By

Headers like Server and X-Powered-By advertise the exact software and version in use, handing attackers a free fingerprint to match against known CVEs. They add nothing for users — strip them or make them generic.

Set-Cookie

Set-Cookie attributes harden session cookies: Secure (HTTPS only), HttpOnly (invisible to JavaScript, limits XSS theft), SameSite (CSRF defence). The __Host- prefix additionally pins a cookie to the exact host. Not scored here, but important.

Access-Control-Allow-Origin

Access-Control-Allow-Origin controls which other origins can read responses from your server via JavaScript. A wildcard or a reflected/null origin together with credentials can expose authenticated data to any site.

Legacy headers

Some headers are obsolete and either do nothing or actively cause harm (X-XSS-Protection's filter introduced XSS holes; Expect-CT and Public-Key-Pins are removed from browsers). Dropping them keeps responses clean.

Scoring (100 pts): CSP 25 · HSTS 20 · X-Frame-Options 8 · X-Content-Type-Options 8 · Referrer-Policy 8 · Permissions-Policy 8 · COOP 6 · COEP 5 · CORP 5 · information disclosure 7. Grades: A+ ≥ 97, A ≥ 90, B ≥ 80, C ≥ 70, D ≥ 60, otherwise F.