Hreflang is an HTML attribute that tells search engines which language and region each version of a page is written for.
If you're asking what is hreflang, you mean the hreflang tag in a page's head. It lists every translated or regional copy of a page so Google can show each searcher the copy in their language.
For a technical SEO lead, hreflang is a set of instructions for international sites, and you'll see it whenever one site serves more than one language or country. A US page and a UK page can share most of their text. Google treats them as alternates of the same page when they use hreflang; without it, Google treats them as rival pages and picks one.
Hreflang tells Google that a group of URLs is one piece of content in different languages or regional variants, and it says which audience each URL serves. Google then swaps in the right URL for a searcher in Germany or Mexico. It's a signal and Google can ignore it. Hreflang doesn't raise rankings, and it doesn't stop a page from being indexed.
Each page in a language group lists itself and every alternate, and each entry carries a language code with an optional region code. The language comes in ISO 639-1 format ("de"), and the region comes in ISO 3166-1 Alpha 2 format ("de-AT"). You can place these annotations in the HTML head or in the XML sitemap. HTTP headers are another option for files like PDFs. Google reads all three the same way. Choose one method per site, because mixing them makes errors hard to trace.
To implement hreflang tags, build the full set of URLs for each page first, then publish the annotations on every version.
This head block belongs on the US English page. The same four lines also appear on the UK and German pages.
<link rel="alternate" hreflang="en-us" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Hreflang affects AI answers only indirectly, through the search index those answers draw on. AI assistants haven't published hreflang rules of their own. When an assistant pulls sources from a search index, clean language signals improve the chance that the site's right local page is cited. Check the cited URL when you test prompts in each market.
The most common hreflang mistakes break the links between versions, so Google drops the whole group without telling you.
Google's documentation states, "If two pages don't both point to each other, the tags will be ignored." When page A names page B, page B has to name page A.
"en-uk" looks right. It's invalid, because the country code for the United Kingdom is "gb". Hreflang pointing to redirected or 404 URLs fails as well.
If a canonical tag points the German page to the English one, it tells Google the German page is a copy. Each version should carry a canonical that points to itself.
Once you know what is hreflang, you'll meet canonical tags next. A canonical picks one preferred URL among duplicates, while hreflang keeps every language version alive. The x-default value is part of hreflang and names the fallback page. Geotargeting is the wider practice of serving content by country, and hreflang is one way to do it.
Look up more AI search and SEO terms in our glossary.