hreflang Tag Generator
Generate hreflang annotations for every language version of a page as HTML link tags, an HTTP Link header or sitemap entries, with code and x-default checks.
Free · No sign-up · Your inputs stay in your browser
Input
Generate hreflang tags
Output
hreflang
389 characters
Every version must list every other version and itself, with the same set on each page; a link that is not returned from the other side is ignored. Use one method per site: HTML for pages, the HTTP header for PDFs, the sitemap when there are many languages. hreflang chooses which URL to show, not which to rank, and it needs each version to be the canonical of itself.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Every page lists every page
hreflang works in both directions: each version must list all versions including itself, with identical sets on every page. A version that is not linked back is ignored. Each version must also be its own canonical, or the hreflang points at a URL that is not indexed. Google's localized versions guide covers the rules.
Choosing a method
Link tags in the head are simplest for HTML pages, the HTTP header suits PDFs and other files, and sitemap annotations keep pages light when there are many languages. Use one method per site.