Definition
Hreflang is an HTML attribute that tells search engines which language and country versions of a page belong together, so a Dutch-speaking visitor sees the Dutch version and a Belgian visitor the Belgian one. You place it as a link tag in the head (<link rel="alternate" hreflang="nl-be" href="…">), in the HTTP header or in the XML sitemap. Every version lists all the other versions and itself.
Without hreflang, Google has to guess which version fits which searcher. That often goes wrong: the English page ranks in the Netherlands, or two near-identical versions (nl-nl and nl-be) compete with each other and are treated as duplicates. Hreflang solves this by treating the versions as one group: signals are shared, but the right URL is shown per country and language.
The codes follow ISO 639-1 for language (nl, en, de) and optionally ISO 3166-1 alpha-2 for country (nl-NL, nl-BE, en-GB). A language without a country is valid ('nl' for all Dutch speakers); a country without a language is not. The special value x-default designates the version shown when no language or region matches, usually a language selector page or the English version.
Hreflang is notorious for being error-prone. The most common mistakes: no return reference (page A lists B, but B does not list A, so the whole annotation is ignored), wrong codes such as 'uk' instead of 'gb', references to URLs that redirect or are non-canonical, and a missing self-reference. Search Console reports these errors under International targeting; a crawler such as Screaming Frog shows per page where the chain breaks.
For AI engines, hreflang is less decisive than for Google, but still useful: it helps them fetch the right language version and prevents an English answer from pointing at your Dutch page. Traze writes multilingual pages as a linked set and publishes the hreflang annotations along with the page, including x-default and self-reference.