Home/Security & Business/Referrer Policy Generator

Referrer Policy Generator

See exactly what each of the eight Referrer-Policy values hands to third parties — then ship the one you meant, with server config for six platforms.

Free Browser-based No signup Copy-ready
Generator Settings
Used to show exactly what each destination would receive. Note how much a full URL can carry.
Options
Generated Header ready
Referrer-Policy

      

How it works

1

Pick a policy

Eight values, each with a plain-English consequence.

2

Check what leaks

A live matrix shows what your sample URL exposes in four scenarios.

3

Ship the header

With an optional fallback value for older browsers.

What the Referer header gives away

When a browser follows a link or loads a subresource, it may tell the destination which page the request came from. That is the Referer header — misspelled in the 1996 specification and never corrected. Under a permissive policy it carries the entire URL, path and query string included.

URLs contain more than you think

Password reset links, invoice numbers, internal search terms, document IDs, and session tokens in legacy systems all live in URLs. Under unsafe-url every one of those is handed to every third-party font, script and tracking pixel the page loads. Nobody intends this; it is simply the default behaviour of a policy nobody set.

Strict means “not over plaintext”

The strict- prefix means the referrer is withheld when moving from HTTPS to HTTP. Without it, your hostname — and sometimes the full path — travels in cleartext where anyone on the network can read it.

The analytics trade-off is real

no-referrer and same-origin are excellent for privacy and they make your outbound traffic invisible to partners. Affiliate links that rely on a referrer stop attributing, and sites you send traffic to will record it as direct. That may be exactly what you want — but decide it deliberately.

The sane default

strict-origin-when-cross-origin is what current browsers already do: full URLs stay inside your site, third parties learn only your origin, and nothing leaks over plaintext. Set it explicitly anyway, so behaviour does not depend on the browser version.

Never make a security decision based on the referrer. It can be omitted, altered or forged by the client, and privacy tooling strips it routinely. It is an analytics signal, not an authentication one — CSRF defences built on it have been broken for two decades.

Frequently Asked Questions

View all FAQs
What is the best Referrer-Policy?
strict-origin-when-cross-origin for most sites. Full URLs within your own origin, only the origin to third parties, and nothing at all on an HTTPS→HTTP downgrade. It is also the current browser default, so setting it explicitly changes nothing except making the behaviour intentional.
What is the difference between origin and strict-origin?
Only the downgrade case. origin sends your origin even when the destination is plain HTTP; strict-origin sends nothing in that situation. There is rarely a reason to prefer the non-strict variant.
Will this break my analytics?
It depends which value you choose. Origin-level policies keep referral source reporting but lose the landing path. no-referrer and same-origin remove referral data from third parties entirely, so partners will record your traffic as direct.
Why is Referer spelled wrong?
A misspelling in the original HTTP specification from 1996 that was too widely implemented to fix. The header is Referer; the policy directive and the DOM property are spelled referrer correctly. Both spellings are correct in their own context.
Can I set a different policy for one link?
Yes. Use referrerpolicy on an individual <a>, <img>, <script> or <iframe>, or rel="noreferrer" on a link. Per-element settings override the document policy.
Should I use the header or the meta tag?
The header, wherever you control the server. A meta tag only applies from the point the parser reaches it, so earlier requests use the default, and it cannot express a fallback list.

Referrer-Policy: what each of the eight values actually leaks

This Referrer-Policy generator shows exactly what every policy value hands to a third party, using your own sample URL, then produces the header with server config for six platforms. Below: what the Referer header carries, which value to choose, and why it must never be trusted.

What the header carries

When a browser follows a link, loads an image, or fetches a script, it may include a Referer header naming the page that triggered the request. Depending on policy, that is either nothing, your origin, or the complete URL.

The complete URL is the problem. Consider https://example.com/account/orders?id=48213&token=s3cr3t. Under a permissive policy, every third-party resource on that page — the font CDN, the analytics beacon, the ad pixel, the embedded map — receives that entire string, token included, in their access logs.

This is not hypothetical. Password reset links, document-sharing URLs, internal search queries and invoice identifiers have all leaked to third parties this way, and the sites involved rarely realised until much later.

The eight values

ValueSame-originCross-originHTTPS→HTTP
no-referrernothingnothingnothing
no-referrer-when-downgradefull URLfull URLnothing
originoriginoriginorigin
origin-when-cross-originfull URLoriginorigin
same-originfull URLnothingnothing
strict-originoriginoriginnothing
strict-origin-when-cross-originfull URLoriginnothing
unsafe-urlfull URLfull URLfull URL
unsafe-url is the only value the specification names as unsafe, and it earns it: the full URL travels to every destination including over plaintext HTTP. There is essentially no legitimate reason to choose it.

Two patterns explain the whole table. strict- means "send nothing on a downgrade to HTTP". -when-cross-origin means "full URL internally, less to outsiders".

Which to choose

strict-origin-when-cross-origin

The default in every current browser and the right answer for most sites. Keeps full URLs internal, gives third parties only your origin, leaks nothing over plaintext.

strict-origin

When even your own pages do not need path-level referrers. Slightly tighter, at the cost of internal analytics detail.

same-origin

When no third party should learn anything at all. Strong privacy; removes your traffic from partners' referral reports entirely.

no-referrer

Maximum privacy. Appropriate for health, legal, financial and internal tools where even your hostname is sensitive.

The three non-strict legacy values — origin, origin-when-cross-origin, no-referrer-when-downgrade — differ from better alternatives only by leaking on a downgrade. Prefer the strict- version in each case.

The analytics trade-off

Tightening this header has a measurable cost, and it lands on other people as much as on you.

  • Origin-level policies keep the referring site visible but lose the referring page. Most analytics tools handle this fine — it is what they already receive from most traffic.
  • same-origin and no-referrer mean partners see your traffic as direct. Affiliate programmes that attribute by referrer will not credit you.
  • Your own inbound reporting is unaffected. This header governs what you send outward, not what other sites send to you.
  • Internal funnels stay intact under any -when-cross-origin value, since same-origin navigation still carries the full URL.
If you need tight privacy globally but referral credit on specific outbound links, keep a strict document policy and relax it per link with referrerpolicy on that anchor. Narrow exceptions beat a loose default.

Per-element overrides

The header sets a document-wide default. Individual elements can be tightened or loosened, and the narrowest declaration wins:

  1. On a link<a href="…" referrerpolicy="no-referrer"> for outbound links to sites you would rather not inform.
  2. With relrel="noreferrer" is the older shorthand and also implies noopener, which is worth having on untrusted links anyway.
  3. On subresourcesreferrerpolicy works on <img>, <script>, <link> and <iframe>.
  4. In JavaScriptfetch(url, { referrerPolicy: "origin" }) controls a single request.
  5. PrecedenceElement beats document meta, which beats the header.

Never trust a referrer

The value arrives from the client, which means it is a claim rather than a fact. It can be omitted entirely, set to anything by a non-browser client, stripped by privacy tooling or a corporate proxy, and suppressed by the sending site's own policy.

Any control that depends on it is broken by construction. That includes referrer-based CSRF defence, hotlink protection treated as security rather than as bandwidth management, and "you must have come from page X" gating. Use tokens for CSRF, authentication for access control, and treat the referrer purely as an analytics signal.

A missing referrer is normal, not suspicious. Between strict policies, privacy browsers and direct navigation, a large share of legitimate traffic arrives with no referrer at all. Systems that treat its absence as an anomaly generate constant false positives.

Related searches

referrer policy generatorreferrer-policy headerstrict-origin-when-cross-originno-referrerreferrer policy meta tagreferer header privacyreferrerpolicy attributerel noreferrerreferrer policy analyticsbest referrer policyreferrer policy valueshttp referer spelling