Free Hreflang Tag Generator

Build hreflang tags for pages in more than one language or region. Get HTML, sitemap or HTTP header code.

Page versions

Add one row per version of the page. Use a language code like en, or a language and region like en-GB.

Fallback page (optional)

Result

Add a code and URL for each version of your page.

    Your tags will show here.

    Runs in your browser. Nothing is sent to a server. Every version must list all the others, including itself.

    Want more people to find your site?

    MiinDigital helps small businesses rank on Google and get cited in AI answers from ChatGPT, Perplexity and Google AI Overviews.

    See our SEO & GEO services

    How to Use the Hreflang Tag Generator

    1. Add each version. Enter the language code and full URL for every version of the page, including your own.
    2. Add a fallback. Optionally enter an x-default URL for visitors whose language you have not listed.
    3. Pick a format. Choose HTML tags, an XML sitemap or an HTTP header.
    4. Copy and add. Copy the result and add the same set to every version of the page.

    What Does the Generator Check?

    • Language codes. checked against the ISO 639-1 list, like en, fr or de.
    • Region codes. two-letter country codes like GB or US, always paired with a language.
    • URLs. must be full addresses with https:// or http://, with no spaces or # fragments.
    • Duplicates. the same code or URL used twice is flagged.
    • x-default. a warning if you have not set a fallback page.
    • Three formats. HTML link tags, XML sitemap entries or an HTTP Link header.

    Why Does Hreflang Matter?

    If you have the same page in several languages, Google can show the wrong one to a visitor. Hreflang tags tell it which version fits which audience. They also help stop your own versions competing with each other.

    Frequently asked questions

    What is hreflang?

    Hreflang is an annotation that tells search engines which language or region a page is for, and where its other versions are.

    Does hreflang improve rankings?

    No. It helps Google show the right version to the right visitor. It is not a ranking boost.

    Do I need an x-default page?

    No, it is optional. It names the page to show when none of your listed languages match the visitor.

    Why must every page list all the others?

    Hreflang works in pairs. If page A points to page B, page B must point back to A, or Google may ignore the tags.

    Which format should I use?

    HTML tags suit most sites. Use the sitemap for large sites, and the HTTP header for files like PDFs. Pick one method per page.

    Is this tool free and does it store my URLs?

    Yes, it is free with no account needed. Everything runs in your browser and nothing is sent to our server.

    Related free tools