Why use Hreflang Tag Generator?
- Choose from 50+ languages and 40+ country-region codes via dropdowns
- Supports the x-default fallback required for proper hreflang implementation
- Copy tags or download a text file to paste into every page head
- Free, private and instant — runs entirely in your browser
About Hreflang Tag Generator
If your website serves content in more than one language or targets users in specific countries, hreflang tags tell Google and other search engines which version of a page to show for a given language or region. Without them, Google may show the wrong language variant to users or treat your pages as duplicate content. Hreflang is especially important for sites with English content targeting both US and UK audiences, or multilingual e-commerce stores serving several European countries.
This free generator lets you add as many language-region combinations as you need, choose from a comprehensive list of ISO 639-1 language codes and ISO 3166-1 region codes, and instantly produces the correct <link rel="alternate" hreflang="..."> HTML. Remember to include an x-default fallback pointing to your default or language-selector page. All processing happens in your browser — nothing is sent to a server.
How to use Hreflang Tag Generator
- 1
Add your language-URL pairs
For each language version of the page, select the language (and optionally a region like US or GB) and enter its full URL.
- 2
Add an x-default row
Click '+ Add Language', choose 'x-default (fallback)' from the language list, and enter the URL of your default or language-selector page.
- 3
Copy and paste into your page head
Copy the generated tags and paste the same complete set into the <head> of every page version listed — each page must reference all the others.
Frequently asked questions
What is an hreflang tag?
An hreflang tag is an HTML link element placed in the <head> of a page that tells search engines the language and optional regional targeting of that page, and points to equivalent pages in other languages or regions.
Do I need to add hreflang tags to every language version?
Yes. Each language version of a page must include the full set of hreflang tags pointing to all versions, including itself. If you only add the tags to one page, search engines may ignore them.
What is the x-default hreflang value?
x-default is a special value that points to the page shown when no other hreflang value matches the user's language. Typically this is your homepage or a language-selection page. Google strongly recommends including it.
Should I use language-only or language-region codes?
Use language-only codes (e.g. hreflang='fr') when you have one version for all French speakers, regardless of country. Use language-region codes (e.g. hreflang='en-GB') when you have region-specific content — different pricing, spellings, or products — for different countries.
Can I implement hreflang in a sitemap instead of the HTML?
Yes. Hreflang can be declared in your XML sitemap using <xhtml:link rel='alternate'> elements. The sitemap approach is easier to maintain for large sites, but both methods are equally valid.
Is this tool free to use?
Yes. The Hreflang Tag Generator is completely free, with no account or signup required. Your URLs are never uploaded anywhere.
Related seo tools
Browse more free tools
Explore every category in our toolbox.