Hreflang Generator & Validator
Create and check hreflang tags so each visitor finds their language.
Check existing tags instead
How to use the Hreflang Generator & Validator
- Add a row for each language or regional version: its code, such as en-GB, and its full address.
- Fix anything flagged: invalid codes, duplicate entries or relative addresses.
- Add an x-default row for visitors whose language you do not offer.
- Copy the HTML tags into every listed page, or use the sitemap or HTTP header format.
About this tool
If your site has the same page in several languages or for several countries, hreflang tags tell search engines which version to show to whom: the German page to German speakers, the British English page to visitors in the UK. Without them, the wrong version can rank, or near-identical regional pages can be treated as duplicates.
The format is strict and mistakes are common. Codes must be a language, optionally followed by a country, as in en, en-GB or es-MX. Typical errors are writing en-UK instead of en-GB, using an underscore, starting with a country instead of a language, or listing a group of countries such as EU. This tool checks every code against the language and region data built into your browser and explains each problem, along with duplicates, relative addresses and a missing x-default.
Hreflang only works when it is reciprocal: every page in the set must list all the others, and itself. The easiest way to guarantee that is to place the identical block generated here on every page in the set. You can also paste the tags from an existing page to check them, or export the set for an XML sitemap or as HTTP headers for PDFs.
Frequently asked questions
What does x-default mean?
It names the page to show when none of the listed languages matches the visitor, often a language selector or the international English page.
Should a page include a tag pointing to itself?
Yes. Each page lists every version, including itself. Using the same block on all pages takes care of this automatically.
Is it en-UK or en-GB?
en-GB. Country codes follow ISO 3166, where the United Kingdom is GB. UK is a common mistake that search engines ignore.
Do I need both en and en-GB?
Not always, but it helps. en-GB targets English speakers in the UK; plain en catches English speakers everywhere else. Without a plain en, others may get x-default.
Does this tool visit my pages?
No. It checks the codes and addresses you enter, entirely in your browser. To confirm pages link back to each other, paste each page's tags into the checker.