HSTS Header Generator — Strict-Transport-Security Ready for Preload
Build RFC 6797 HSTS headers ready for hstspreload.org submission.
This header meets the hstspreload.org header requirements.
- ✓ max-age of at least 31536000 (1 year)
- ✓ includeSubDomains present
- ✓ preload token present
- ○ Check by hand: a valid HTTPS certificate on the main domain
- ○ Check by hand: HTTP redirects to HTTPS on the same host
- ○ Check by hand: every subdomain serves HTTPS
When to use the Strict-Transport-Security (HSTS Preload) Generator
Force HTTPS in the browser
Once a browser receives this header it always opens the site over HTTPS for the max-age period, which makes downgrade attacks and cookie theft on public networks much harder.
Preload requirements checked
A max-age of at least one year, includeSubDomains and the preload token are checked against the hstspreload.org rules, plus a list of things to check on your server by hand.
Roll out step by step
Start at 300 seconds, move to one day, then to one year. Durations are shown in plain words so a missing zero does not slip through.
Formats for your server
A raw header, Nginx with always so it is also sent on error responses, Apache, Caddy or a _headers file, ready to copy or download.
Frequently asked questions
Which max-age should I use?
For production, at least 31536000 seconds (1 year); many sites use 63072000 (2 years). Start with a small value while testing.
Is HSTS sent over plain HTTP?
It would be useless: browsers ignore an HSTS header received over HTTP. Send it only on HTTPS responses and redirect all HTTP to HTTPS.
How do I withdraw HSTS?
Send max-age=0 over HTTPS. For a domain already on the preload list, also request removal at hstspreload.org.
Do I need includeSubDomains?
It is required for preload and advisable once every subdomain is on HTTPS. If an old subdomain still lacks HTTPS, fix it before turning this on.
Similar tools
- Browser Fingerprint & Entropy Privacy TestAudit exposed Canvas, WebGL, timezone, screen & hardware traits in your browser.
- Live localStorage & sessionStorage InspectorInspect keys and byte footprint stored locally on this origin in your browser.
- X.509 SSL/TLS Certificate (PEM) DecoderDecode X.509 certificates (PEM or DER): subject, issuer, SANs, validity and expiry, key type and size, extensions, SHA-256 fingerprint and the chain signature.
- Certificate Signing Request (CSR) DecoderDecode a PKCS#10 CSR: subject, requested SANs, key type and size, signature algorithm, and verify its signature before sending it to a CA.