Saif Techlogix · Free SEO tool

Hreflang Tag Generator: Build and Check Hreflang for Every Version

List each language or country version of a page and the generator writes the hreflang tags for you, as HTML link tags, an XML sitemap or HTTP headers. It also catches the mistakes that make Google ignore hreflang, such as en-UK instead of en-GB, a missing x-default or relative URLs.

  • HTML, sitemap or headers
  • Validates language and region codes
  • x-default built in
  • en-US, en-GB, de, fr presets

Your page versions

One line per version: language-region code, full URL. The region is optional (use “de” for all German speakers, “de-AT” for Austria only).

Checks

    Versions

    CodeMeansURL

    Your hreflang code

    Going international?

    We plan and run international SEO: hreflang, country targeting, translated content and local links for each market.

    See international SEO services

    What Are Hreflang Tags?

    Quick answer: hreflang tags tell Google which version of a page to show to people in each language or country. If you have a US pricing page in dollars and a UK version in pounds, hreflang makes sure UK searchers see the UK page. Each version lists every alternate, including itself, plus an optional x-default for everyone else.

    Without hreflang, Google guesses. It may show your US page in the UK, treat near-identical English pages as duplicates, or rank the wrong version in each country. Hreflang does not boost rankings on its own, but it makes sure the right page gets the traffic you already earn.

    How to Use the Hreflang Tag Generator

    1. List each version on its own line: the code, a comma, then the full URL.
    2. Add an x-default URL, usually your main or language-selector page.
    3. Use a preset if you want to add the common English or European sets quickly.
    4. Click Generate tags and read the checks. Errors are in red.
    5. Pick a format: HTML link tags, an XML sitemap or HTTP headers, then copy or download the code.

    Hreflang Codes Explained

    The code is a language, optionally followed by a region. The language uses ISO 639-1 (two letters, such as en, de, fr). The region uses ISO 3166-1 alpha-2 country codes (such as US, GB, CA, AU).

    CodeMeansUse it when
    enEnglish speakers anywhereOne English page for everyone
    en-USEnglish speakers in the USPrices, spelling or offers differ by country
    en-GBEnglish speakers in the UKNote: GB, not UK
    deGerman speakers anywhereOne German page for Germany, Austria and Switzerland
    fr-CAFrench speakers in CanadaCanadian French content
    x-defaultEveryone not covered aboveA main page or a language picker

    You cannot target a country without a language. “GB” on its own is not valid, and neither is “en-EU”, because the EU is not a country code.

    Common Hreflang Mistakes

    • en-UK instead of en-GB. The UK country code is GB. The generator fixes this for you.
    • Missing return links. If the US page points to the UK page, the UK page must point back. Every version needs the full set.
    • No self-reference. Each page should list itself as well as the others.
    • Relative URLs. Hreflang needs full URLs with https://.
    • Pointing to redirected or noindexed pages. Every URL should return 200 and be indexable, with a canonical tag pointing to itself.
    • Mixing methods badly. You can use HTML tags or a sitemap. If you use both, they must match exactly.

    HTML Tags, Sitemap or HTTP Headers?

    HTML link tags in the page head are the simplest choice for small sites, and most WordPress translation and SEO plugins can add them. An XML sitemap keeps the page code clean and is easier to manage at scale, which suits large ecommerce sites. HTTP headers are for files that have no HTML head, such as PDFs. Google supports all three, as its localized versions guide explains.

    Hreflang and International SEO

    Hreflang is one part of international SEO. The others are deciding on a URL structure (subfolders such as /uk/, subdomains or country domains), writing content for each market rather than translating word for word, using local prices, spelling and contact details, and building some local links in each country. A US company expanding to the UK and Australia often only needs subfolders, hreflang and properly localised pages to start.

    Hreflang Generator Results Explained

    CheckWhat it meansWhat to do
    Code changed from en-UK to en-GBUK is not a valid country codeUse the corrected code
    No x-defaultNo fallback for other visitorsAdd your main page as x-default
    Same code listed twiceTwo URLs claim the same audienceKeep one URL per code
    Regions without a general language versionSpeakers elsewhere have no clear pageAdd a general code such as “en”
    http and https mixedInconsistent URLsUse the final https URLs

    The default example lists six versions plus x-default, so the HTML block has seven link tags to place on every version.

    Get It Done for You: Saif Techlogix International SEO

    Saif Techlogix is an international SEO service for businesses expanding across the US, UK, Canada, Australia and Europe. We set up hreflang with tools like this hreflang tag generator, fix URL structures, localise content and build links in each market.

    See our international SEO service. Or contact us for a free quote.

    Hreflang Tag Generator FAQ

    Do hreflang tags improve rankings?

    Not directly. They help Google show the right language or country version, which improves clicks and stops versions competing with each other.

    Is it en-GB or en-UK?

    en-GB. The ISO country code for the United Kingdom is GB, so en-UK is invalid and Google ignores it.

    What is x-default in hreflang?

    The fallback page for visitors whose language or country does not match any version you list, often your main page or a language picker.

    Do I need hreflang if all my pages are in English?

    Yes, if you have different versions for the US, UK, Canada or Australia, such as different prices or spelling. If one English page serves everyone, you do not.

    Should I use HTML tags or a sitemap for hreflang?

    Either works. HTML tags are simpler for small sites; a sitemap is easier to manage on large sites. If you use both, keep them identical.

    Is the hreflang tag generator free?

    Yes. It is free, needs no sign-up and runs in your browser.

    Related Free Tools

    Scroll to Top