Hreflang tag generator
Turn a list of language versions into a complete set of hreflang tags.
Hreflang tag generator
Hreflang tags tell search engines which URL to show for which language and region, so a French visitor lands on /fr/ instead of the English homepage. Writing them by hand does not scale past two or three versions: every page needs a link back to every other page, including itself, and one missed reciprocal link is enough for Google to ignore the whole set. Paste a list of language codes and URLs, one pair per line, and this tool builds the complete cross-linked set for you.
Enter each language version as a code and a URL, such as "en https://example.com/" or "pt-BR https://example.com/br/", on separate lines. The tool checks that each code has a plausible language(-region) shape and that each URL is absolute, skips anything that does not, and reports how many entries were skipped or repeated so a typo does not silently produce a broken set. Choose the output that fits where you are pasting it: HTML link tags for a page's head, HTTP Link headers for a server that cannot edit HTML (PDFs, images), or an XML fragment with xhtml:link alternates for each URL in your sitemap.
Add an x-default tag to cover visitors whose language does not match any listed version — search engines fall back to it, and browsers use it for a language-picker page. Pick which entered language it should point to, or type a line starting with "x-default" yourself to set the URL directly. A single language version has no page to link back to, so the tool treats hreflang as meaningful only once at least two are entered.
Everything runs locally in your browser. The URLs and language codes you enter for a hreflang set are often unpublished site structure, and none of it is uploaded anywhere — the tags are generated on your device and nowhere else.