Skip to content
AZ Tools

Referrer-Policy Header Builder

Pick a Referrer-Policy value and see exactly what Referer header outbound requests will send — same-origin, cross-origin HTTPS, HTTPS→HTTP downgrade.

Response header
Referrer-Policy: strict-origin-when-cross-origin
Meta tag form
<meta name="referrer" content="strict-origin-when-cross-origin">
What gets sent
ScenarioReferer sent
Same origin (HTTPS→HTTPS, same host)https://app.example.com/page?id=42
Cross-origin (HTTPS→HTTPS, different host)https://app.example.com/
Downgrade (HTTPS→HTTP)(no header)

Apply the header on every HTML response. The <meta name="referrer"> tag helps when you can't control headers (static hosting that doesn't let you set them, etc.).

How to use

  1. Pick a policy. The default for modern browsers is strict-origin-when-cross-origin — leak only the origin when leaving HTTPS for HTTPS, and nothing on a downgrade.
  2. Read the three example rows to see exactly what the browser would send.
  3. Copy the response header (preferred) or the <meta> tag (works inside an HTML page when you can't control headers).

About this tool

Show

The Referrer-Policy header controls how much of your URL travels in the Referer request header when someone follows a link out or the page fetches a subresource. Pick one of the eight standard policies and the builder shows exactly what a receiving server would see in three situations that matter: a request to your own origin, a cross-origin request over HTTPS, and a cross-origin request that downgrades to plain HTTP. Both the response-header form and the <meta name="referrer"> form are emitted, so you can set the policy at the server or inside HTML that a CDN has already cached.

The spelling is not a typo on our side. The header was written Referer in the 1996 HTTP specification, the mistake was noticed too late to change, and every implementation has carried it since. The policy header that controls it is spelled correctly, as is the JavaScript property document.referrer, so any code touching both has to get the two spellings right in the same file.

The default matters more than most people realise, because it changed. Browsers used to send the full URL to any HTTPS destination, and modern Chrome, Firefox and Safari now default to strict-origin-when-cross-origin: your own origin gets the whole URL, another origin gets only the scheme and host, and a downgrade to HTTP gets nothing at all. That default is already a sensible privacy position, which means the main reasons to set the header explicitly are to tighten it further or to document the intent.

Tightening has a cost worth weighing. A URL leaks whatever is in its path and query string — a password-reset token, a document identifier, a search phrase someone typed — and no-referrer closes that completely. It also erases your site from every analytics dashboard you would otherwise appear in, breaks referral attribution for partners who measure traffic you send them, and stops some servers accepting the request at all, because hotlink protection is usually implemented by checking exactly this header. strict-origin is the middle position: the receiving site learns you sent the visitor without learning which page they were on.

Frequently asked questions

Which policy is the safe default?

strict-origin-when-cross-origin. It sends the full URL for same-origin (your analytics still works), only the origin for cross-origin HTTPS, and nothing when downgrading to HTTP. This is the implicit default in modern browsers if you don't set a policy.

Why is unsafe-url flagged?

It sends the full URL (including query string) to every destination, even on HTTPS→HTTP downgrades. Query strings often contain tokens, ids and personal info — unsafe-url leaks them to the network and to whatever ad/analytics/embed lives at the destination.

Why did my analytics stop attributing traffic after tightening this?

Because attribution reads the Referer header, and a strict policy trims it to the origin or removes it entirely on cross-origin requests. That is the intended effect — the path of the page someone came from often contains a search term, a document name or an account identifier — so the fix is to pass the campaign information you actually need in the link, not to loosen the policy.

Does the policy hide the referrer from the page I link to?

It controls what the browser sends in the header, which is what a server logs and what a third-party script reads there. It does not stop the destination learning where a visitor came from by other means: a parameter in the URL, a click identifier, or a person simply telling them. Treat it as reducing what leaks by default, not as anonymity.

Related tools