Skip to main content

HTTP Security Headers Grader

Paste your HTTP response headers to get a security grade. Analyzes Content-Security-Policy, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, and more.

✓ A-F grading per header ✓ Overall security score ✓ Recommended values ✓ Missing headers list ✓ Impact score per fix
How to get your headers: In Chrome DevTools → Network tab → click any request → Response Headers section. Or in terminal: curl -I https://yourdomain.com

Frequently Asked Questions

What are HTTP security headers and why do they matter?▼

HTTP security headers are response headers that instruct browsers to enable built-in security protections. They defend against XSS, clickjacking, MIME sniffing, and data leakage attacks. Unlike application-level fixes, security headers can be added in minutes and immediately improve your security posture. A missing Content-Security-Policy, for example, leaves you vulnerable to XSS attacks that could steal user data or session cookies.

What is Content-Security-Policy and how do I set it up?▼

CSP (Content-Security-Policy) tells browsers which sources of scripts, styles, images, and other resources are allowed to load on your page. It's the most powerful XSS defense available. Start with a report-only policy: Content-Security-Policy-Report-Only: default-src 'self'. Watch your browser console and report endpoint for violations. Gradually tighten until violations stop, then switch to enforcing mode. A strict CSP: default-src 'self'; script-src 'self' 'nonce-{random}'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:;

What does Strict-Transport-Security (HSTS) do?▼

HSTS tells browsers to only connect to your site over HTTPS, even if users type http://. It prevents SSL stripping attacks and protocol downgrade attacks. After a browser sees HSTS, it will automatically upgrade HTTP requests to HTTPS for the duration of max-age. Include 'includeSubDomains' if all your subdomains support HTTPS. Use 'preload' only after you're confident HTTPS works perfectly — preload list entries are hard to remove. Start with max-age=300, then increase to 31536000 (1 year) once stable.

Is X-XSS-Protection still useful in 2026?▼

X-XSS-Protection is deprecated and should be disabled by setting it to 0. The browser's built-in XSS auditor (which this header controlled) has been removed from Chrome/Firefox. Worse, in some browsers it could actually introduce vulnerabilities by interfering with page rendering. Rely on Content-Security-Policy for XSS protection instead — it's far more comprehensive and modern.

How do I add security headers in common server setups?▼

Nginx: add headers in your server{} block with 'add_header Header-Name value always;'. Apache: use Header set or Header always set in .htaccess or httpd.conf. Express.js: use the helmet npm package — it sets most headers automatically with sensible defaults. Cloudflare: use Transform Rules or Workers to add headers. Vercel/Netlify: use headers in vercel.json or _headers file. Always test after adding headers as CSP especially can break functionality.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →