Skip to content

Referrer-Policy explainer

Free, no sign-up Runs in your browser

Pick a Referrer-Policy and see the exact Referer header sent for same-origin, cross-origin and HTTPS to HTTP requests. All eight policies in one table.

Used to show the exact Referer header. It stays in your browser.

What strict-origin-when-cross-origin sends

Same origin
https://example.com/account/reset?token=abc123
Another site, HTTPS to HTTPS
https://example.com/
Downgrade, HTTPS to HTTP
No Referer header
HTTP header
Referrer-Policy: strict-origin-when-cross-origin

All eight policies

PolicySame originAnother site, HTTPS to HTTPSDowngrade, HTTPS to HTTP
no-referrerNothingNothingNothing
no-referrer-when-downgradeFull URLFull URLNothing
originOrigin onlyOrigin onlyOrigin only
origin-when-cross-originFull URLOrigin onlyOrigin only
same-originFull URLNothingNothing
strict-originOrigin onlyOrigin onlyNothing
strict-origin-when-cross-originFull URLOrigin onlyNothing
unsafe-urlFull URLFull URLFull URL

The full URL is the address without its fragment (the part after #) and without any user name or password. Origin only is the scheme, host and port, such as https://example.com/.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the Referrer-Policy explainer

  1. Choose a policy from the list.
  2. Enter the address of a page on your site, or keep the example.
  3. Read what is sent in each of the three cases.
  4. Compare with the table of all eight policies and copy the header.

About this tool

When a visitor follows a link or a page loads an image or script, the browser tells the destination where the request came from in the Referer header. The Referrer-Policy header controls how much it says: the full URL, only the origin, or nothing. It matters because URLs carry more than people expect, such as search terms, account IDs and password-reset tokens.

Each of the eight policies answers three questions: what is sent to the same origin, what is sent to another site over HTTPS, and what is sent when the request goes from HTTPS down to plain HTTP. The table shows all of them side by side, and the example uses a page address you enter, so you can see the exact header.

Browsers default to strict-origin-when-cross-origin when no policy is set: the full URL within your own site, the origin only to other sites, and nothing on a downgrade. That is a good choice for most sites. The values to avoid are unsafe-url and no-referrer-when-downgrade, which hand full URLs to third parties. Even with a strict policy, keep secrets out of URLs.

Sources

Questions

Which Referrer-Policy should I use?

strict-origin-when-cross-origin suits most sites and is the browser default. Use same-origin or no-referrer when other sites should learn nothing, for example on pages with sensitive paths. Setting the header explicitly makes older browsers behave the same way.

What is the default Referrer-Policy?

Current versions of Chrome, Firefox, Edge and Safari use strict-origin-when-cross-origin when a page sets no policy. Older browsers used no-referrer-when-downgrade, which sends full URLs to other HTTPS sites.

What is the difference between origin and strict-origin?

Both send only the scheme, host and port. origin sends it on every request, including from an HTTPS page to a plain HTTP destination. strict-origin sends nothing on such a downgrade, so the origin does not travel unencrypted.

Why is it spelled Referer in one header and Referrer in the other?

The request header Referer was misspelled in the original HTTP specification and the spelling stuck. The newer Referrer-Policy header uses the correct spelling. Both spellings are right for their own header.

Related tools