Free Hreflang Tag Generator
Build the rel=alternate hreflang set that maps a page to its translations, validated as you type for the mistakes that silently break it — missing x-default, one-way references and malformed language tags.
Language versions
Every page in the set must list all of them, itself included.
hreflang must be reciprocal: if the French page points at the English one, the English page has to point back. A one-way declaration is ignored.
Format
Paste into the <head> of every page in the set.
Output
<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Why use the Hreflang Generator
Private by design
No account needed. What you type stays in your browser unless you ask for an AI suggestion or name a URL to fetch.
Validated before you paste
Mistakes that silently break these files, such as redirect loops, one-way hreflang and unescaped URLs, are caught first.
Ready to deploy
Copy the output or download the file, ready for your server config or site root.
Frequently asked questions
Does every page need to reference itself?
Yes, and this is the most common mistake. Each page in the set must list the complete set including its own URL. A page that lists only its siblings is treated as an incomplete cluster and is frequently ignored.
What is x-default for?
It names the page to serve visitors whose language you do not target — usually your language selector or your primary-market page. Without it those visitors get whichever version Google guesses.
Do hreflang references have to be reciprocal?
Yes. If the French page points at the English one, the English page must point back. Google discards one-way declarations entirely.
Should I use en-GB or just en?
Use the bare language unless you genuinely have region-specific content. en-GB and en-US only earn their keep when the pages actually differ in currency, spelling, stock or law.
Updated · Built by Niraj Kumar