1. Free tools
  2. Hreflang Generator

FREE HREFLANG GENERATOR

Hreflang Generator: correct hreflang tags

A free hreflang generator. Add each language or region URL and this tool builds the reciprocal, self-referencing hreflang tags - as HTML <link> elements, XML sitemap markup or an HTTP header - with x-default. No signup, nothing leaves your browser.

  • HTML, sitemap & HTTP header
  • Reciprocal with x-default
  • No signup required

HANDLES CODES LIKE

Your language versions

Add the URL of each language or region version of the same page. Use a code like en, en-GB or pt-BR (ISO 639-1 language, optional ISO 3166-1 region).

HreflangPage URL
Fallback for users whose language or region matches none of the above - often a language selector or global homepage.

Generated tags


    Generated in your browser. Nothing is uploaded.

    HOW IT WORKS

    From a list of URLs to valid hreflang tags in seconds

    Hreflang annotations tell Google which language or region version of a page to show each user. They must be reciprocal and self-referencing: every page in a set has to list itself and every other version, or Google ignores them.

    1. Add each version

      Enter the hreflang code and URL for each language or region of the same page, plus an optional x-default. Rows validate as you type.

    2. Pick a format

      Switch between HTML <link> tags, XML sitemap markup and an HTTP Link header - the generator builds the full reciprocal set for each one.

    3. Copy and deploy

      Paste the HTML into every page’s head, the markup into your sitemap, or send the header. Use one method consistently across the site.

    WHAT THIS TOOL GENERATES

    Three output formats, all reciprocal and self-referencing

    One list of URLs, three ready-to-ship outputs. Each page gets the complete set of alternates, including a link back to itself, so return links are never missing.

    HTML

    <link> tags for the head

    rel="alternate" hreflang link elements for every page, ready to paste into the <head> of each localized URL.

    SITEMAP

    XML sitemap markup

    A urlset with xhtml:link alternates per url entry - the easiest way to maintain hreflang on large sites from one file.

    HTTP

    HTTP Link header

    A Link header for non-HTML files such as PDFs, where you cannot add a tag in the head.

    RETURN LINKS

    Self-referencing sets

    Every page lists itself and all siblings, so each alternate links back - the return-link rule Google requires.

    X-DEFAULT

    x-default fallback

    Add one x-default URL and it is included in every set as the fallback for unmatched languages and regions.

    CHECKS

    Inline code checks

    Duplicate codes, relative URLs and malformed codes are flagged as you type, before you ship them.

    GENERATOR VS HAND-CODING

    Reciprocal hreflang is easy to get wrong by hand

    On n language versions you need every page to reference all n URLs, including itself. That is n×n links to keep in sync. A generator builds the full matrix at once, then you validate the result.

    What you getThis GeneratorHand-codingNo hreflang
    Reciprocal return links✓ Every pageEasy to missNone
    Self-referencing tags✓ AutomaticOften forgottenNo
    HTML, sitemap & header✓ All threeOne at a time-
    x-default included✓You add itNo
    Which version Google servesYou control itYou control itGoogle guesses
    Audit hreflang across every page✓ With SiteAuditLintManualNo

    After you deploy, confirm the tags with the hreflang validator and re-crawl the site to catch any missing return links.

    FAQ

    Hreflang generator questions

    What is a hreflang generator?

    A hreflang generator turns your list of language or region URLs into the hreflang annotations that tell Google which localized page to show each user. This tool outputs the reciprocal, self-referencing tags as HTML <link> elements, XML sitemap markup or an HTTP Link header.

    Is this hreflang generator free?

    Yes. It is free with no signup, and it runs entirely in your browser, so nothing you type is uploaded. To audit hreflang across a whole site, download the free SiteAuditLint desktop app.

    Where do I put hreflang tags?

    Use one method consistently. Put the HTML <link> elements in the <head> of every page, or put the xhtml:link alternates in your XML sitemap, or send them as an HTTP Link header for non-HTML files such as PDFs. Do not mix methods for the same pages.

    Do hreflang tags need to be reciprocal?

    Yes. Every page in a set must list every language version, including itself. If page A links to page B but B does not link back to A, Google ignores the annotation. This generator outputs the full self-referencing set for each URL so the return links are always present.

    What is the x-default hreflang value?

    x-default marks the fallback page for users whose language or region matches none of your alternates, such as a language selector or a global homepage. Add an x-default URL and the generator includes it in every set.

    Is en-UK a valid hreflang code?

    No. The ISO 3166-1 code for the United Kingdom is GB, so the correct value is en-GB. Use an ISO 639-1 language code, optionally a hyphen and an ISO 3166-1 Alpha-2 region, such as en, en-GB or pt-BR.

    How do I check my hreflang after adding it?

    Deploy the tags, then run each page or your sitemap through the hreflang validator to confirm the codes, return links and x-default. For a whole site, the SiteAuditLint desktop app crawls every page and flags broken hreflang sets.

    Generate hreflang for one set here. Audit hreflang across every page with SiteAuditLint.

    Hreflang errors hide in return links: one page that forgets to link back breaks the whole set. Only a crawl of every localized page finds them all.

    Download SiteAuditLint