About the Hreflang Tag Generator
Hreflang Tag Generator writes the hreflang tags that tell Google which language or country version of a page to show to which visitors. List each version on its own line as a code and a web address, such as en-us, https://example.com/us/, include an x-default fallback and the page produces the link tags for the head of your pages and the same information as XML sitemap entries. It fixes the capitalisation of codes, checks the format of each line, finds duplicates and reminds you of the rules, such as every page linking to every version including itself.
Updated October 2026
How to use the Hreflang Tag Generator
- 1Write one language version per line: the code, a comma, the full address.
- 2Add an x-default line for the fallback page.
- 3Read the warnings under the result.
- 4Copy the link tags and paste them into the head of every version, or use the sitemap XML.
- 5Check that every version lists all the others.
When you need hreflang
Use hreflang when you have the same or very similar content in several languages, or in one language for several countries, such as English pages for the US, UK and Australia. Without it, Google may show the wrong version or treat near-identical pages as duplicates. Sites with only one language do not need it.
How to use the result
Paste the link tags into the head section of every version, so that each page contains the full list. If you have many pages, the sitemap version is easier to maintain. After publishing, check the Google Search Console international targeting reports for errors.
- Every page lists every version, including itself
- Use full, absolute addresses
- Use the same address Google sees, with or without a trailing slash
- Add x-default for visitors who match no language
Common mistakes
The most common mistakes are missing return links, a wrong language code such as en-UK (the correct region for the United Kingdom is GB), relative addresses and pointing at pages that redirect. The generator catches formatting errors, but you must make sure that the pages exist and link back.
Related tools
Create a sitemap with the XML Sitemap Generator, control crawling with the Robots.txt Generator and preview search results with the SERP Snippet Preview. The Meta Tag Generator and the Schema Markup Generator help with other head tags.
Features
- Link tags for the head
- XML sitemap version
- Fixes code capitalisation (en-us becomes en-US)
- Checks codes, addresses and duplicates
- x-default reminder
- Private: nothing is uploaded
Frequently asked questions
What is hreflang?
An HTML attribute that tells search engines which language or regional version of a page is meant for which audience, so that users in the UK see the UK page and users in Spain the Spanish one.
What do the codes look like?
A language code such as en or es, optionally followed by a region such as GB or MX, for example en-GB. Scripts such as zh-Hant-TW are also valid. x-default marks the fallback.
Where do I put the tags?
In the head of every page version, with the full list on each page. Alternatively, put them in an XML sitemap or in HTTP headers for non-HTML files.
Do all versions need to link to each other?
Yes. Every version must list all the versions, including itself, and every link must be returned. Missing return links make Google ignore the tags.
What is x-default?
The page to show when no language version fits the visitor, often a language picker or the main English page.
Does hreflang change my rankings?
It does not directly raise rankings, but it helps Google show the right version, reduces duplicate-content confusion between near identical pages and improves click-through for local visitors.
Can I use only a language, not a region?
Yes. Use en for all English speakers or add the region only when your pages really differ by country, for example prices in dollars or pounds.
Is my list uploaded?
No. The tags are made in your browser.