Free tool

hreflang tag generator

List each language or country version of a page and get hreflang tags as HTML, XML sitemap entries or HTTP headers, with common mistakes flagged.

Your input never leaves your browser.

Page versions

Lines starting with # are ignored.

Output

    How to use it

    1. Add one line per version: a language-region code, then the full URL. For example: en-GB, https://example.com/uk/.
    2. Include every version, including the page itself. Add x-default for the fallback page.
    3. Copy the HTML into the head of every version. Each page must list all versions, and they must link back to each other.

    Limits. The tool checks the list you paste. It cannot confirm that each page links back to the others or that the URLs are live, which Google also requires.

    Questions

    Which codes are valid?

    A language code (en), optionally followed by a region (en-GB, en-US, en-AE, en-CA, fr-CA, ar-AE). The region on its own is not valid, and en-UK is a common mistake: the UK is GB.

    What is x-default?

    The version to show users who do not match any listed language or region, often a language selector or your main page.

    Do I need hreflang for one English site?

    Only if you publish separate versions for different languages or countries with substantially similar content. A single site does not need it.

    Does hreflang improve rankings?

    It helps search engines show the right version to the right user. It is a signal, not a ranking boost.

    More free tools

    The ZYFR letter

    Search visibility, minus the fluff.

    Occasional, practical notes on SEO, AI-search visibility and site performance. Unsubscribe any time.

    By subscribing you agree to receive occasional emails from ZYFR. See the privacy notice.