INTERNATIONAL SEO · FREE TOOL
Connect your language and regional pages with accurate hreflang markup.
Generate HTML tags or XML sitemap annotations, including x-default. No account, payment or API needed. Your entries are processed in this browser and are not sent to Degates.
← All free SEO toolsCheck existing hreflang tags
Checks are local. Reciprocal return tags on other pages cannot be verified from pasted markup alone.
Import language URLs from CSV
Build localized URLs
Generated URLs are unverified. Check them before publishing. Existing path text is preserved; translated slugs are never guessed. A matching source-locale prefix is replaced; otherwise the target prefix is added. For custom URL structures, choose manual entry.
2. Copy or download your code
Inputs changed. Generate again to refresh the output.
Download a separate sitemap for each host. Each includes all alternates but only this host’s URLs as sitemap entries. Publish at that host’s root, or merge into its existing sitemap.
How to use the Hreflang Tag Generator
- Add one entry for each language or regional version of the same page. Include the current page and, optionally, an x-default fallback.
- Generate the code. Choose HTML tags or XML sitemap output.
- For HTML, put the identical complete set inside the
<head>of every alternate page. For XML, include each page’s self-reference and all alternates; upload each host’s sitemap at its root or integrate with your sitemap system. - Check that your URLs are canonical, crawlable and indexable, and that every alternate points back to the others. Regenerate when URLs change.
This tool checks input syntax; it does not fetch URLs, verify translations or guarantee Google indexing. Choose the implementation method that fits your site; you do not need both HTML and XML.
HTML hreflang example for US and UK pages
Suppose your delivery guide has separate English versions for US and UK customers, plus a language selector. Enter en-US, en-GB and x-default with the corresponding URLs. This free hreflang tag generator produces the following set for the head of each page:
<link rel="alternate" hreflang="en-US" href="https://example.com/us/delivery/">
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/delivery/">
<link rel="alternate" hreflang="x-default" href="https://example.com/choose/delivery/">
Use your own equivalent pages, not these example addresses. A US product page and a UK category page are not interchangeable. If one English page serves all countries, use en; choose en-US only when that version targets US English speakers.
What x-default does
The selector above gives unmatched visitors a useful destination. You can instead use an appropriate general version of the same page. x-default is optional: it does not replace the language entries or mean that the destination must be English.
Return tags and self-references
When the US page names the UK page, the UK page must name the US page in return. Each page also includes its own URL. Keep one shared alternate list for this guide so an update does not leave different sets on different pages.
XML sitemap hreflang example
Choose XML output when your sitemap system is the easier place to maintain language relationships. This two-page example lists both pages and repeats their alternate links in each entry:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/us/delivery/</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/us/delivery/" />
<xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/uk/delivery/" />
</url>
<url>
<loc>https://example.com/uk/delivery/</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/us/delivery/" />
<xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/uk/delivery/" />
</url>
</urlset>
If you add a fallback, include its x-default link in every entry and its URL as a sitemap entry too. For pages on different hosts, use the generator’s host selector to download each host’s file. Merge annotations into your existing sitemap workflow instead of replacing a sitewide sitemap with this small example.
Hreflang and canonical tags
Hreflang describes audience alternatives; a canonical identifies a preferred URL among duplicates. For distinct translated pages you intend to index, use the appropriate canonical for each language rather than sending every translation to the English page. Same-language regional pages with substantially duplicate content may need a different canonical strategy.
Before generating annotations, decide which URLs belong in the alternate set. The Canonical URL Generator helps format the preferred URL’s tag; it does not choose that URL for you. If your SEO or translation plugin already manages these tags, update that configuration rather than adding competing markup.
Common hreflang mistakes
- Using
USalone oren-UK. Use a language code, optionally followed by a supported region, such asen-USoren-GB. - Linking alternate pages without return tags or omitting the current page from its own list.
- Using redirected, removed or nonindexable URLs instead of the intended final pages.
- Pasting HTML annotations into the visible page body instead of its head, or omitting the XHTML namespace in XML.
- Assigning the same locale to two different URLs in one set. Choose the intended destination for that audience.
- Leaving outdated language URLs in a template or sitemap after a migration.
Related tools for multilingual pages
After connecting your language versions, draft a relevant title and summary for each audience with the Meta Tag Generator. Use the canonical tool above when preparing canonical markup, and keep each language’s page information consistent with what visitors actually see.
Hreflang generator FAQs
What is hreflang?
Hreflang identifies equivalent language or regional versions of a page so search engines can understand which version is intended for each audience.
What does x-default mean?
It identifies a fallback page for visitors whose language or region does not match the other entries, often a language selector or general page.
Which language and region codes can I use?
Use an ISO 639-1 two-letter language, optionally with an ISO 3166-1 two-letter region, such as en-GB. Supported script examples include zh-Hans and zh-Hant. A region alone, such as US, is not a language.
Do I need reciprocal and self-referencing tags?
Yes. Each alternate should include itself and link to every other alternate, with the same set repeated on those pages.
Can alternate pages be on different domains?
Yes. HTML annotations can reference different domains. XML output is separated by host so each sitemap lists its own host’s pages while referencing the complete alternate set.
Is my data saved or submitted?
This generator does not submit, store or fetch your entries. Code generation, copying and downloading happen in your browser. Refreshing the page clears the form.
Where do I add hreflang in WordPress?
Check whether your translation plugin already outputs language annotations. Configure the alternate URLs there when possible. Otherwise use your existing head-management or sitemap integration. A page content block is not the place for live head tags.
Should I use HTML tags or an XML sitemap?
Choose the method your team can keep accurate when pages change. HTML is convenient when you control the page head; XML is useful when your publishing system centralizes sitemap updates. Maintaining both does not provide an extra search benefit.
Will hreflang improve my US rankings?
Hreflang helps identify an appropriate language or regional version. It does not guarantee a ranking increase. A US version should still answer US visitors’ needs with suitable terminology, offers and useful content.
