Hreflang Tag Generator
Add a language/URL pair for each localized version of your page and get the matching hreflang link tags.
About the Hreflang Tag Generator
Running the same content in multiple languages creates a duplicate-content puzzle unless search engines know which version belongs to which audience. Hreflang link tags solve that by pairing a language or region code with each translated URL, the special x-default value covers visitors whose locale doesn't match any listed page, typically a language picker or a default English version. A correct set needs every localized URL added, including the page currently being viewed.
Hreflang tags have to be reciprocal, or they get ignored
This is the single most common way an hreflang setup silently fails: if the English page lists the French page as an alternate, the French page also has to list the English page back, and every other language in the set. Google treats a one-directional reference as unreliable and may ignore the entire cluster rather than guess at the intended relationship. This tool's output is meant to be pasted identically into the head of every URL in the list, the same block of tags, unchanged, on every localized version, which is exactly what makes the references reciprocal.
Language codes versus region codes
A code like en targets English broadly, en-us targets English specifically for users in the United States, and en-gb does the same for the UK, these are different signals and shouldn't be mixed up. A frequent mistake is entering a bare region code like us on its own, hreflang expects a language code first, with an optional region code second, a country code with no language specified isn't valid and gets ignored rather than interpreted as intended.
What x-default is actually for
x-default isn't a language, it's a fallback flag for visitors whose browser locale doesn't match any of the listed language or region codes. It's typically pointed at either a language-selection landing page or whichever version, often English, serves as the site's default. Leaving it out isn't an error, but including it gives searchers outside every listed locale a sensible page to land on instead of an arbitrary guess by the search engine.
Hreflang doesn't replace a canonical tag
Each localized page should still carry its own self-referencing canonical tag alongside its hreflang tags, hreflang and canonical solve different problems, hreflang says which language a page serves, canonical says which URL is authoritative for that specific content. Canonicalizing every language version back to a single URL, a mistake sometimes made when adapting an existing canonical setup for a new language rollout, undermines the entire point of having separate localized pages in the first place.
Head tags aren't the only way to declare hreflang
This tool generates <link> tags for a page's head, which is the most common implementation, but Google also accepts the same information delivered through an HTTP header (useful for non-HTML files like PDFs where there's no head to add a tag to) or listed inside an XML sitemap using xhtml:link entries. A sitemap-based approach is often the more practical choice for a site with a large number of language pairs, since it centralizes every relationship in one file instead of requiring the same reciprocal block pasted into dozens or hundreds of individual page heads.
Ranking impact versus what hreflang actually controls
Hreflang doesn't influence how well a page ranks on its own, it only controls which URL variant gets shown to a searcher based on their language and location settings. A page with strong hreflang implementation but weak content still ranks according to that content's own quality, hreflang's job is purely routing the right regional or language audience to the right existing URL, not boosting any of them.
Frequently Asked Questions
Why do hreflang tags need to be reciprocal?
Google treats a one-directional hreflang reference as unreliable and may ignore the entire set of tags rather than guess at the intended relationship. Every page in the group needs to list every other page, including itself, and the exact same block of tags should be pasted identically into each localized page's head.
What's the difference between "en" and "en-us"?
"en" targets English speakers broadly regardless of region, while "en-us" targets English speakers specifically in the United States. A bare region code with no language, like "us" alone, isn't valid hreflang syntax and gets ignored.
Do I need an x-default tag?
It's optional but recommended. x-default is a fallback for visitors whose locale doesn't match any listed language or region, typically pointed at a language-selector page or a site's default language version, rather than leaving that traffic to land on an arbitrary guess.
Should each language version still have its own canonical tag?
Yes. Hreflang and canonical solve different problems, hreflang identifies which language a page serves, canonical identifies the authoritative URL for that specific content. Each localized page should have a self-referencing canonical alongside its hreflang tags, not one pointing back to a single "main" language version.
Does hreflang help my page rank higher?
No, not directly. Hreflang controls which URL variant is shown to a searcher based on their language and location, it doesn't boost ranking on its own. A page's ranking still depends on its own content quality, hreflang's role is purely making sure the right regional or language version reaches the right audience.