Create proper hreflang tags for multi-language and regional sites
Hreflang tells search engines which language and region version of a page to show which user. Getting the syntax wrong is easy and the failure is silent. This generator writes the tags correctly.
Enter each URL with its language and optional region, and the generator returns a complete set of link tags. Those go in the <head> of every page in the group, not just one of them.
The language code follows ISO 639-1 and the region code follows ISO 3166-1 Alpha 2. Language alone is valid: en means English anywhere. Language plus region narrows it: en-GB means English for the United Kingdom. Region alone is not valid, so GB on its own will be ignored, which is one of the two errors that account for most broken implementations.
<link rel="alternate" hreflang="en-US"
href="https://example.com/pricing/" />
<link rel="alternate" hreflang="en-GB"
href="https://example.com/uk/pricing/" />
<link rel="alternate" hreflang="es-ES"
href="https://example.com/es/precios/" />
<link rel="alternate" hreflang="x-default"
href="https://example.com/pricing/" />
Every page in that set carries all four tags, including a tag pointing at itself. That is the return tag rule, and it is the second error that breaks most implementations. If the Spanish page points at the English page but the English page does not point back at the Spanish page, the relationship is not confirmed and both tags are discarded. Hreflang is a mutual declaration, not a one-way hint.
The x-default entry is the fallback for users whose language and region match nothing in your set. It usually points at your primary market or a language selector. It is optional, and leaving it out means those users get whichever version the search engine guesses at.
Beyond missing return tags and invalid region codes, three failures repeat. URLs in hreflang tags must be absolute and must include the protocol, because relative paths are ignored. The URLs must be the canonical version of each page, so pointing hreflang at a URL that then canonicals somewhere else cancels the whole set. And a page cannot be in two groups: one page, one hreflang cluster.
The tags can also be served in an XML sitemap or in an HTTP header instead of in the page head. All three are valid, and mixing methods for the same page is where debugging becomes genuinely unpleasant. Pick one.
Do I need hreflang if my site is one language in several countries?
Yes, if you have separate URLs per country. That is exactly what region codes are for, and without them the versions compete with each other.
Does hreflang help me rank higher?
No. It changes which of your existing pages is shown to which user. It is a targeting mechanism, not a ranking one.
Can I point hreflang at another domain?
Yes. Country-code domains are a normal setup and hreflang works across them, provided every domain in the set returns the matching tags.
Is this tool free?
Yes, with no account and no limit.
Hreflang errors travel in pairs, and a generator only fixes the tag in front of you. An account adds the crawl that finds the rest.
Free tools stay free · No card required
This free tool is one slice of the job. The full kit - rank tracking, audits, competitor gaps, content, and your visibility across ChatGPT and Google's AI Overviews - runs on credits you only spend when you use them. Sign up and we'll drop 25 credits in your account to try the paid tools on us.