Hreflang Tag Generator
Help search engines connect equivalent pages for different languages or regions. Build a complete alternate set, including the current page, so each version points to the same family of content.
The right page. In the right language.
IN YOUR BROWSER / PRIVATE INPUTGood input. Useful output.
Connect language and regional versions of your pages.
Try the example, or make it your own.How to use the
Hreflang Tag Generator
- 01
Collect equivalent page URLs
Use final absolute URLs for the same content in each language. Do not pair a translated article with a generic homepage simply because that language exists on the site.
- 02
Add a language tag to every URL
Enter language, URL on each line, such as en, https://example.com/en/guide. Use a language-region tag when the regional distinction is real, and x-default for an appropriate fallback.
- 03
Publish the complete set everywhere
Copy the generated link elements into each alternate page's head. Keep the self-reference and all reciprocal references. Recheck the whole set when one URL changes.
One guide, two translations and a fallback
An English guide and a French guide should reference both URLs. A language-selection page can serve as the fallback when no listed language is a suitable match. The same set belongs on each member of the alternate group.
en, https://example.com/en/guide
fr, https://example.com/fr/guide
x-default, https://example.com/choose<link rel="alternate" hreflang="en" href="https://example.com/en/guide" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/guide" />
<link rel="alternate" hreflang="x-default" href="https://example.com/choose" />What each part of the annotation means
The form validates supported language-tag syntax and absolute URL formatting. It does not request the alternate pages, detect their language or prove that reciprocal markup has been deployed. A clean export is the beginning of verification, not the end.
| Part | Meaning | Review question |
|---|---|---|
| rel=alternate | The linked page is an alternate version. | Is its main content genuinely equivalent? |
| hreflang=en | A language-level audience annotation. | Does the page actually use that language? |
| hreflang=en-GB | A language with a regional distinction. | Is there a real reason for a separate regional URL? |
| hreflang=x-default | A fallback outside the listed language matches. | Does this URL help a visitor choose or continue? |
| href | The absolute alternate page URL. | Does it resolve directly to the intended page? |
Keep canonicals and language alternates consistent
Canonical tags express a preferred URL for a page; hreflang describes alternate language or regional versions. They solve different problems. Review both signals together so a translated page is not unintentionally treated as a disposable duplicate of another language.
A spreadsheet of alternate groups can make maintenance easier. Give every translated resource one row, with columns for languages, final URLs, publication status and last verification. When a translation disappears, update every page that references it rather than leaving a one-way alternate behind.
Three small mistakes that break the relationship
Using a country alone
A regional audience still needs a language. Start with a language code and add a region when appropriate; a country name is not a substitute.
Leaving a redirect in the set
Prefer the final destination URL. A migration can change both the canonical address and the reciprocal set, so verify these together.
Mixing page types
The tool cannot know whether /fr/ is the translation of /en/guide. Compare the actual page content before publishing the relationship.
Hreflang Tag Generator:
questions, answered.
Should a page reference itself in hreflang?
Yes, include the current page in the complete alternate set, alongside the other versions. Keep the set consistent across those versions.
Is x-default required for every translated website?
It is useful when you have an appropriate fallback or language selector. Do not invent a fallback URL simply to fill a field; decide what unmatched visitors should reach.
Does this tool generate sitemap hreflang annotations?
No. It exports HTML link elements for a page head. The XML Sitemap Generator produces a basic URL sitemap, not a localized sitemap extension.
Can this generator confirm return links?
No. It checks the entered data and creates tags. Inspect each published page or use a crawler that verifies reciprocal annotations across the entire set.
The calculations and checks above describe this tool's implementation. Use these primary references for the underlying formats and publishing guidance.
Localized versions of your pages ↗ (opens in a new tab)Connect the whole language family.
Generate one complete set, publish it on every alternate and verify the relationships in both directions.
Use the Hreflang Tag Generator↑