Technical SEO guide
Writing hreflang tags by hand is exactly the kind of thing worth not doing by hand
hreflang tells search engines which URL to show a visitor based on their language and region — a German-language searcher gets the /de page, a UK searcher gets /en-gb, and so on, even though all versions can rank for the same query. Getting the syntax right by hand across a dozen language variants is tedious and easy to typo; this tool validates every code and builds the tags for you.
What a valid entry needs
- A valid language code — ISO 639-1, like
en,de,tr. Optionally followed by an ISO 3166-1 Alpha-2 region, likeen-GBorpt-BR. The same validator the Hreflang Checker uses runs here, so a code this tool accepts is a code that checker will also accept. - An absolute URL — the full
https://...address of that language’s version of the page, never a relative path. - x-default — not a language code at all, but a reserved keyword marking the fallback page for a visitor whose language matches none of the listed alternates. Usually a language-selector page or the international homepage.
Common mistakes this catches
- An underscore instead of a hyphen —
en_GBinstead ofen-GB. - A three-digit numeric region code instead of a two-letter country code.
- The same language code entered twice, pointing at two different URLs.
- A relative URL that only works because it happened to be tested on the live domain.
The reciprocity rule this tool can’t check
hreflang only works as a mutual declaration: the English page must link to the German page, and the German page must link back to the English one — a one-directional hreflang tag is commonly ignored by Google. This generator produces the tags for one page in isolation; each language version needs its own generated set including all the others. Once every page is live, the Hreflang Checker verifies that reciprocity actually holds across live pages.
Frequently asked
Do I need hreflang if my site is only in one language?
No — hreflang exists specifically to manage multiple language or region variants of the same content. A single-language site has nothing for it to declare.
Where do these tags go?
In the <head> of every page in the set, or as an HTTP Link header for non-HTML content (a PDF, for instance) — or listed in the XML sitemap using the equivalent xhtml:link syntax.
Is x-default required?
Not strictly, but recommended — without it, a visitor whose language/region matches none of the alternates gets whatever Google’s own fallback logic decides, rather than the page actually meant for them.
