Home › SEO Tools › Hreflang Tag Generator

Hreflang Tag Generator

Build hreflang tags for every language version of a page, as HTML, an XML sitemap or HTTP headers, with every code checked.

Mode

One row per language version of the same page. Type a code such as en-GB, or pick from the list.

Output

    How to use the hreflang tag generator

    Add one row for each language or country version of a page. The tags build as you type, with checks for every code.

    1. Type a code such as en-GB, or pick one from the list.
    2. Add the full URL of that version.
    3. Add an x-default URL for everyone else.
    4. Choose HTML tags, an XML sitemap or HTTP headers.
    5. Copy the code. Every page in the set gets the same block.

    For a whole site, switch to Many pages. Paste a table with codes in the first row and one page per row. The tool builds every block, or one full sitemap.

    What is hreflang?

    Hreflang is an attribute that links versions of a page made for different languages or countries. It helps Google show the right version to each searcher.

    Without it, a UK visitor might land on your US prices. A French speaker might see the English page. Hreflang fixes that by naming each version.

    How hreflang codes work

    A code starts with a two-letter language from ISO 639-1. You can add a script, and then a country from ISO 3166-1.

    CodeMeaning
    enEnglish, any country
    en-GBEnglish for the United Kingdom
    zh-HantChinese in Traditional script
    x-defaultThe fallback for everyone else

    The country alone is never valid. “be” means Belarusian, not Belgium. For the UK, the code is GB, so en-UK is wrong.

    The rules Google applies

    • Each version must list every version, including itself.
    • Links must go both ways. If page A names page B, B must name A.
    • Use full URLs with https://.
    • Point only to canonical, indexable pages.
    • Use one method per page: HTML, HTTP headers or the sitemap.

    HTML tags, sitemap or headers?

    HTML tags are simplest for small sites. They go in the head of every version.

    An hreflang XML sitemap suits large sites, because the page code stays clean. Each URL gets its own entry listing all its versions.

    HTTP headers are for files without a head, such as PDFs. The server sends a Link header with every version.

    Why this hreflang generator is different

    Many href lang generator tools offer only HTML tags and do not check the codes. This one validates every code and gives three outputs.

    • Checks against the full ISO language and country lists.
    • Catches en-UK, region-only codes, underscores and three-letter codes.
    • HTML tags, an XML sitemap and HTTP headers.
    • A bulk mode for whole sites from a pasted table.

    It works as an hreflang tag generator tool and as an hreflang generator for sitemaps. Already have tags live? Test them with the Hreflang Tag Validator.

    Private by design

    The hreflang tag generator runs in your browser. Nothing you type or paste is sent to a server, and there is no sign-up.

    Your last settings are saved on this device only. The tool is ready when you come back.

    Frequently asked questions

    What is an hreflang tag?

    An HTML attribute that links language or country versions of a page. It helps Google show each searcher the right one.

    Is en-UK a valid hreflang code?

    No. The code for the United Kingdom is GB, so use en-GB.

    Do I need x-default?

    It is optional. It names the page for users who match none of your versions.

    Does each page need to list itself?

    Yes. Every version carries the full set, including a link to itself.

    HTML tags or sitemap?

    Tags are simplest for small sites. A sitemap keeps the code clean on large sites. Use one method.

    Can I target a country without a language?

    No. Hreflang always starts with a language. Add the country after it, such as fr-BE.

    Is case important?

    No. en-gb and en-GB work the same. The tool writes the standard form for readability.

    Is this hreflang generator free?

    Yes. There is no sign-up and no limit.

    Last reviewed 2026-11-30 · How we build and check our tools