Start a project

Tool 33 of 57 · SEO

Hreflang Tag Generator

Tell search engines which language and country each version of a page is for, with tags that are checked for the mistakes that make Google ignore them.

Hreflang Tag Generator at a glanceIllustration: 1, Language versions; 2, processed in your browser; 3, hreflang tags.Hreflang Tag Generator1Language versions?utm_source=&utm_medium=&utm_campaign=3hreflang tags2In yourbrowser
1 Language versions 2 processed on your device 3 hreflang tags

Hreflang Tag Generator

One page in every language

Codes are ISO 639-1 languages (en, fr) with an optional ISO 3166 region (en-GB). x-default is the fallback page.

Checks

    Your tags

    HTML <head> tags (the same on every version)
    Or: sitemap entries
    Or: HTTP Link header (for PDFs)

    01

    What it does

    Builds hreflang tags, sitemap entries or headers for each language version, and checks the codes and x-default.

    • Language and region codes checked (en-GB, not en-UK)
    • x-default fallback check
    • Self-reference and duplicate checks
    • HTML, XML sitemap and HTTP header formats

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    HTML tags, sitemap XML and a Link header, with a Copy and a Download button on every result.

    • hreflang
    • International SEO

    Why it matters

    If you run a site in more than one language, or separate versions for the UK and the US, hreflang tells Google which one to show each searcher. Without it, the wrong version ranks, or the versions compete as duplicates.

    Hreflang is also easy to get wrong: 'en-UK' is not a valid code (the UK is GB), every version must list all the others and itself, and mistakes are silently ignored. This generator writes the full set and checks the codes.

    How it works

    1. InputThe URL of each language version
    2. In your browserCodes checked, return links completed
    3. OutputHead tags, sitemap entries and Link headers

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Launching or extending a multilingual site.

    By the numbers

    hreflang tags needed as you add languages2 languages: 6 tags across the set; 3 languages: 12 tags across the set; 4 languages: 20 tags across the set; 6 languages: 42 tags across the set; 8 languages: 72 tags across the set; 10 languages: 110 tags across the set2 languages6 tags across the set3 languages12 tags across the set4 languages20 tags across the set6 languages42 tags across the set8 languages72 tags across the set10 languages110 tags across the set
    Computed: every version must list every version, itself included, plus x-default, so n languages need n × (n + 1) tags in total. That's why big sites move hreflang into the sitemap, which this tool also writes. Source: Google Search Central: localized versions.
    Show the numbers as a table
    LanguagesTags in total
    26
    312
    420
    642
    872
    10110

    How to use it

    1. List each language or region code and that version's address.
    2. Add an x-default line for visitors who match none of them.
    3. Read the checks and fix anything in red.
    4. Put the same set of tags on every version of the page, or use the sitemap output instead.

    FAQ

    Is it en-GB or en-UK?

    en-GB. Region codes are ISO 3166, where the United Kingdom is GB. 'en-UK' is invalid and ignored.

    Does every page need the tags?

    Every version of a page must carry the same full set, including a link to itself. If page A links to B but B doesn't link back, both are ignored.

    Tags, sitemap or headers?

    They do the same job; use one. Tags are simplest for a few pages, sitemaps scale better, and headers are for files like PDFs.

    Does Bing use hreflang?

    Bing relies mostly on the content-language meta tag and html lang. It's worth setting both as well.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk