Free Online Tool
Security Headers Generator
Pick a hardening level and your server type. Get copy-paste ready security header config in seconds.
What headers does this generate?
All configs include these foundational security headers, scaled by your selected level:
- Strict-Transport-Security (HSTS): forces browsers to always use HTTPS. Critical to prevent downgrade attacks.
- X-Content-Type-Options: stops browsers from MIME-sniffing the content type. Blocks one class of XSS.
- X-Frame-Options: prevents your site from being loaded inside an iframe by other domains. Stops clickjacking.
- Referrer-Policy: controls how much referrer info leaks when users click outbound links.
- Permissions-Policy: disables browser features (camera, mic, location) you don't need.
- Content-Security-Policy (Strict / Maximum only): the most powerful XSS defense. Hardest to configure correctly.
- Cross-Origin-* (Maximum only): isolates your site from other origins. Required for SharedArrayBuffer / WebAssembly threading.
Pick the right level for your site
- Basic: the minimum every site should have. Won't break anything. Use this for legacy sites or third-party-heavy CMS like WordPress with many plugins.
- Strict: recommended for new projects, single-page apps, and any site without complex third-party integrations. Aim for A grade on Mozilla Observatory.
- Maximum: paranoid mode. Will likely break embedded fonts, analytics scripts, ad networks, and inline styles unless you tune CSP carefully. Test in staging first.
After you apply the config
- Deploy the config to your server.
- Run our Security Scorecard against your domain.
- Re-check at Mozilla Observatory for an external second opinion.
- Aim for A grade or above on both.