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.
curl -I https://yourdomain.com Header Analysis
Priority Fixes (Sorted by Impact)
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.
Related Products
on GumroadPremium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →GitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
HTTP Security Headers Generator
Generate HTTP security headers configuration for nginx and Apache. Configure HSTS, CSP, X-Frame-Options, Referrer-Policy, and more with toggle switches. Copy ready-to-use configs.
Open free tool →
HTTP Status Code Reference
Complete HTTP status code reference. Search all 1xx, 2xx, 3xx, 4xx, and 5xx codes with plain-English descriptions, real-world use cases, and when to use each in REST APIs.
Open free tool →
Content Security Policy Builder
Visual CSP builder with all directives. Generate Content-Security-Policy headers with source expressions, nonces, and report endpoints.
Open free tool →
More Free Tools
Related Articles
Complete Guide to HTTP Security Headers: CSP, HSTS, and Modern Browser Security 2026
Master HTTP security headers in 2026: Content-Security-Policy configuration, HSTS preloading, Permissions-Policy, COEP/COOP for cross-origin isolation, and real-world configs for nginx, Apache, and Next.js.
HTTP Headers Explained: Security & Performance (2025)
A developer's guide to HTTP headers. Covers security headers (HSTS, CSP, CORS), performance headers (Cache-Control, ETag), and how to inspect headers with free tools.
DevSecOps Tools Checklist 2026: 20 Essential Tools for Shift-Left Security
Complete DevSecOps tools checklist for 2026. 20 essential SAST, DAST, SCA, secrets scanning, and container security tools with free/open-source options.
Kubernetes Security Hardening: 15 Essential Practices
A comprehensive guide to Kubernetes security hardening—RBAC, Pod Security Standards, network policies, secrets management, and container scanning with real examples.
Web Security Best Practices 2026: Complete Guide for Modern Developers
Comprehensive web security guide for 2026 covering OWASP Top 10, Content Security Policy, CORS, HTTPS/TLS hardening, XSS prevention, CSRF protection, SQL injection prevention, and security headers. Includes practical code examples for Node.js, Python, and Go.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →