HSTS Header Generator
Configure max-age, includeSubDomains, and preload options to generate a ready-to-use Strict-Transport-Security header with server config snippets.
Use the HSTS Header Generator
Configure HSTS Header
Presets
Generated Header
Strict-Transport-Security: max-age=31536000
Server Config Snippets
Copied!
Summary
The HSTS Header Generator helps you create a correctly formatted Strict-Transport-Security header. Choose from common max-age presets or enter a custom value, toggle includeSubDomains and preload options, and instantly get server configuration snippets for Nginx, Apache, Caddy, and Node.js/Express.
How it works
- The tool assembles the Strict-Transport-Security header value from your chosen options entirely in the browser. It validates preload requirements (max-age >= 31536000 and includeSubDomains must be enabled) and generates ready-to-use server configuration blocks.
Use cases
- Enforce HTTPS on all visitors and prevent SSL-stripping attacks.
- Prepare a domain for submission to the HSTS preload list.
- Generate server configuration snippets for DevOps deployments.
- Audit and validate existing HSTS header settings.
Frequently Asked Questions
Last updated: 2026-06-13 · Reviewed by Nham Vu