HSTS Header Builder
Builds the Strict-Transport-Security header with max-age, includeSubDomains and preload as selected.
Common values: 31536000 (1 year), 15768000 (6 months), 300 while testing.
Forcing HTTPS without locking yourself out
HSTS has three parameters and most people copy them from Stack Overflow without knowing what each one does. Here you pick a max-age in seconds, decide whether subdomains are included and whether preload is set, and get the finished Strict-Transport-Security line. Defaults are 31536000 seconds, which is one year, with includeSubDomains turned on.
The detail that catches people out: browsers only honour HSTS when the header arrives over a valid HTTPS connection. Sending the same header on a plain HTTP response does nothing at all. The max-age clock also restarts on every visit, so a frequent visitor stays pinned to HTTPS more or less forever. The yes/no fields expect the Portuguese word sim to switch a flag on, and anything else counts as off. Leave max-age empty and you get max-age=0, the official way to switch HSTS off.
Think twice before ticking preload. It puts your domain on a list compiled into browser binaries, removal takes months, and it only reaches users who update. Before that, make sure every subdomain works over HTTPS, including intranet hosts, staging and that old admin panel. The builder assembles the string but does not validate the preload prerequisites, so confirm them at hstspreload.org. In nginx and Apache you configure the header name and value separately, so copy only the part after the colon.
Frequently asked questions
What max-age should I use?
What does includeSubDomains do?
How do I turn HSTS off later?
Related Tools
HSTS Header Builder
Assembles a Strict-Transport-Security header line from a max-age in seconds plus optional includeSubDomains and preload directives, ready to paste into a config.
Basic CSP Evaluator
Evaluates a Content-Security-Policy directive reporting unsafe-inline, unsafe-eval or wildcard issues.
Referrer-Policy Builder
Builds the Referrer-Policy header from a standard value (strict-origin, no-referrer, etc.).
Permissions-Policy Builder
Builds the Permissions-Policy header from a list of feature=allowlist entries (e.g. geolocation=()).
Email Header Analyzer
Analyzes a raw email header: Received server chain, per-hop delays, SPF, DKIM, DMARC results and spoofing warning signs.
Clear-Site-Data Header Builder
Build a Clear-Site-Data header (cache, cookies, storage, executionContexts) — useful on logout to wipe origin data.