Free Hreflang Tag Generator
Paste your language/region URLs and get valid hreflang tags back, link elements for the <head>, plus an hreflang sitemap, with the x-default and return links Google requires.
- Self-referencing tags
- x-default included
- Sitemap + header output
Language versions
Hreflang Generator
Hreflang markup
Generated result
<!-- Validation: format checks passed; URLs were not fetched. -->
<!-- Paste this identical block into the <head> of EVERY URL below.
Each page must list itself as well as its alternates, or Google ignores the set. -->
<link rel="alternate" hreflang="en-us" href="https://example.com/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="de-de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Covers 4 language versions plus x-default.Where this tool fits
How to use the hreflang generator
Hreflang generator: what the output does
A hreflang generator creates the alternate-language links that connect localized versions of the same page. Hreflang is a signal rather than a directive, so Google still decides which URL to show. Generate the complete set here, then inspect one localized page with the international SEO audit before publishing it across the site.
The rule that breaks most implementations
Hreflang has to be reciprocal. If your English page points to the French page, the French page must point back to the English one, and every page in the set must also point to itself. Miss a return link and Google ignores the whole cluster silently, no error, no warning, just no effect. That single rule accounts for most hreflang setups that look correct and do nothing, which is why this generator emits the full set for every URL rather than the one tag you happen to be editing.
Language codes, region codes, and x-default
The language code is ISO 639-1 (en, fr, de) and is required. The region code is ISO 3166-1 Alpha-2 (US, GB, FR) and is optional; use it only when the content genuinely differs by country, such as pricing in a different currency. `en-GB` targets English speakers in Britain; plain `en` targets English speakers anywhere. Note the codes are language-then-region: `en-GB`, never `GB-en`. Add x-default for the page you want shown when nothing else matches, typically a language selector or your primary market.
Hreflang Spanish and regional examples
For a Spanish version, use `es` when one page serves all Spanish-speaking users, or a regional code such as `es-ES` when the content, currency, or legal details differ. Keep the Spanish URL in the same complete set as the English page, and repeat the full set on every page. If the set belongs in an XML sitemap, choose the sitemap output below and check that every URL returns the same language alternatives; a generated tag cannot repair a redirect, canonical conflict, or missing return link.
Hreflang sitemap generator: use XML output at scale
Choose XML sitemap output when a site has many localized pages or when you want one centrally managed alternate-language file. Keep the complete language set on every URL, use absolute URLs, and confirm the sitemap is submitted and returns 200; this hreflang sitemap generator creates the alternate links but cannot submit or validate the published file for you.
Where to put the output
HTML link tags go in the <head> of every page in the set. The XML sitemap version is usually easier to maintain at scale because it lives in one file instead of being spread across templates, and it is the only practical option once you pass a few dozen locales. HTTP headers are for non-HTML files such as PDFs, which have no <head> to put tags in. Pick one method and use it consistently, then check the returned markup with the free Googlebot simulator; mixing methods on the same page is a common source of conflicting signals.
Hreflang Generator FAQ
Is the hreflang generator free?
Yes. The hreflang generator is free to use on Seobase with no signup required for the on-page hreflang markup.
Can I use the hreflang generator for SEO content?
Yes. The tool is built for search-focused workflows and pairs best with human review before publishing.
What is an hreflang tag generator?
It creates the alternate-language link tags that connect localized versions of the same page. This generator also includes self-references, x-default, XML sitemap output, and HTTP-header output, but you still need to publish the result on every page and verify reciprocal links.
Can this generate an hreflang sitemap?
Yes. Choose XML sitemap as the output format to create the xhtml:link alternate entries for each URL in the language set. Submit the finished sitemap in Search Console and verify that every URL returns 200 with reciprocal alternates.
Do I need a self-referencing hreflang tag?
Yes. Every page in the set must include a tag pointing at itself alongside the tags pointing at its alternates. Google treats a set without self-references as invalid, and this generator includes them automatically.
What is x-default for?
It marks the fallback page for searchers whose language and region do not match anything in your set, a language-picker page, or your main market. It is optional, but without it Google guesses, and it usually guesses your highest-authority version.
Should I use hreflang or canonical tags?
Both, but carefully. Each language version should carry a self-referencing canonical, not a canonical pointing at the English original, that combination tells Google to drop every translation from the index, which is the single most common way sites delete their own international traffic.
Why is my hreflang not working?
In order of frequency: missing return links, a canonical pointing at a different language, invalid or reversed region codes, and URLs in the tags that redirect or 404. Check those four before anything else, they cover the overwhelming majority of broken implementations.
Related free tools
Paste one localized page's rendered HTML and check its language, hreflang, canonical, and fallback signals before international pages split their relevance across regions.
Enter a page URL and get every image it references — img tags, responsive srcset variants and the Open Graph image — as a plain list of direct links.
Enter a site and get every icon it declares — favicon, apple-touch-icon, mask-icon and each declared size — as direct links you can open or save.
Related articles
Short answer: An international SEO audit checks whether each language or country version can be crawled, indexed, canonicalized, and matched to the right searcher. Start with representative URLs, then verify status codes, self-referencing canonicals, reciprocal hreflang, lang attributes, localized content, internal links, and sitemap coverage.
Short answer: Technical SEO makes a page reachable, crawlable, and understandable to search engines. On-page SEO makes the page the best answer for a searcher. Fix technical blockers first, then improve the page’s intent match, structure, and evidence. Doing more of one cannot compensate for a failure in the other.
Your next customer is searching right now.
Start today and your first articles can be live this week, on your site and in your voice, quietly picking up keywords while you get on with everything else.
3 days free · Cancel anytime