HSTS Header Generator
Generate HTTP Strict-Transport-Security (HSTS) headers with max-age, includeSubDomains, and preload directives, check HSTS preload list requirements, and copy
Loading tool...
What is HSTS Header Generator?
A Strict-Transport-Security (HSTS) header generator for enforcing HTTPS in the browser. Pick a max-age window from quick presets, add includeSubDomains and preload directives, verify the result against HSTS preload list requirements, and copy the finished header along with nginx, Apache, and Express.js deployment snippets.
Key Benefits
- Force repeat visitors onto HTTPS and neutralize SSL-stripping attacks
- Ramp up safely: short max-age while testing, years in production
- Instant feedback on HSTS preload eligibility before you submit anything
- Correct directive syntax and ordering without manual typos
- Matching server snippets for nginx, Apache, and Express.js
Common Use Cases
- β’Harden a production site after confirming every subdomain supports HTTPS
- β’Test an HSTS rollout on staging with a short 5-minute max-age
- β’Prepare a domain for submission to the official hstspreload.org list
- β’Add the header flagged as missing by a security scanner or pentest report
How to Use the HSTS Header Generator
- Choose a max-age value: Enter the number of seconds browsers should enforce HTTPS, or pick a preset. Start with a short window such as 5 minutes while testing, then move to one or two years once you are confident every subdomain serves valid HTTPS.
- Set the directives: Enable includeSubDomains to cover every subdomain of your host. Enable preload only when you plan to submit the domain to the official HSTS preload list built into Chrome, Firefox, and Edge.
- Check preload requirements: If preload is enabled, review the checklist: max-age must be at least one year, includeSubDomains must be set, and you should understand that removal from the preload list can take months.
- Copy and deploy the header: Copy the generated Strict-Transport-Security header, or grab the ready-made nginx add_header, Apache Header always set, or Express.js middleware snippet and deploy it so the header ships on every HTTPS response.
Key Features
- Live Strict-Transport-Security header built from max-age, includeSubDomains, and preload options.
- Six max-age presets ranging from a 5-minute testing window to two-year production values.
- Preload readiness checklist validating the one-year max-age and includeSubDomains requirements.
- Copy-ready outputs for the raw header plus nginx add_header, Apache Header always set, and Express.js middleware.
- Bilingual EN/TH interface, fully offline, nothing leaves your browser.