SEO Tools

Hreflang Generator

Generate hreflang tags for multilingual and multi-regional SEO in HTML, XML sitemap, and HTTP header formats.

Worked example and publication checks
Browser-basedNo accountReady to use

Hreflang Generator

Create HTML tags, XML sitemap entries, or HTTP Link headers for localized page versions.

Localized URLs
Output format
Output

Add at least one locale and URL.

    From input to publication

    Worked example: one service in three markets

    A fictional service has matching pages for Austria, Germany, and English-speaking visitors. A separate language selector acts as the fallback. Build one group for these equivalent pages, not one group for the entire website.

    Example inputs

    de-AT
    https://example.com/at/service/
    de-DE
    https://example.com/de/service/
    en
    https://example.com/en/service/
    x-default
    https://example.com/choose-language/
    Output format
    HTML tags

    Alternate links for all four pages

    <link rel="alternate" hreflang="de-AT" href="https://example.com/at/service/" />
    <link rel="alternate" hreflang="de-DE" href="https://example.com/de/service/" />
    <link rel="alternate" hreflang="en" href="https://example.com/en/service/" />
    <link rel="alternate" hreflang="x-default" href="https://example.com/choose-language/" />

    Canonical on the Austrian page only

    <link rel="canonical" href="https://example.com/at/service/" />

    Publish the complete group on each version

    In the generator, use three language rows and put the selector URL in the x-default field. Add the four alternate links to the HTML head of each of the four pages. Each page references itself and the other versions. The fallback page also needs the return links.

    The canonical line shown separately belongs only on the Austrian page. The German and English pages use their own canonical URLs. Copying the Austrian canonical onto every translation sends a conflicting signal about which page should represent the content.

    Keep the relationship specific to the content

    Repeat this process for a second service with its own translated URLs. Do not point every Austrian page at the German homepage: those are not equivalent destinations. If a translation does not exist yet, omit it until a real matching page is available.

    Use de-AT for German aimed at Austria. AT alone is not a language. Generic en is useful when there is one English version; regional variants only make sense when the pages actually target separate audiences.

    Diagnose an incomplete deployment

    Suppose the Austrian page includes the group but the German template has no alternate links. The generator output is not the problem: deployment is incomplete. Inspect both published page sources and restore the missing return links.

    Make a small verification table with one row per destination: requested URL, final URL, HTTP status, canonical, and alternate targets. Redirects, old paths, or a language switcher pointing to the wrong service become much easier to spot side by side.

    Choose one output format you can maintain

    HTML is convenient when you control the page template. XML can fit a centrally maintained sitemap workflow; HTTP Link headers are useful for resources such as PDFs. Using all three adds maintenance work without giving this example an extra benefit.

    This generator does not fetch the URLs. A syntactically correct set still needs a live check after publication, especially when a CMS, redirect rule, or translation plugin can change the final addresses.

    Verification checklist

    1. Generate the example and count four alternate links, including x-default.
    2. Open each URL without relying on your logged-in session. Record redirects and confirm that the intended page returns HTTP 200.
    3. Inspect all four page heads: each must contain the same four alternate targets. Check the canonical separately on every translated page.
    4. After adding or removing a translation, update the whole group, not only the new page.

    Example and source review: .

    Find a missing return link: a working example

    These six published sample pages describe the same fictional website service in Austrian German, German and English. Compare their HTML source: one group deliberately omits a link, while the other contains the corrected annotations.

    Before: the German page does not link back to English

    The English page lists the German URL, but the German page has no hreflang="en" annotation. That relationship is not reciprocal. It does not mean every other correctly linked pair is automatically invalid.

    After: all three pages list the same three URLs

    1. View the source of the two German pages and compare the alternate links in the head.
    2. Open each destination. The language code should match the page, and each page should include its own URL.
    3. On your website, also verify the final HTTP response, indexability and canonical URL. Matching annotations alone do not guarantee which result Google will show.

    These educational fixtures intentionally use noindex, follow and are excluded from our sitemap. Do not copy that robots directive to a production page you want indexed. There is no language selector in this example, so no x-default URL is necessary.

    Verification, : all six locally served pages returned successfully. Browser tests inspected the annotations in the actual HTML head, confirmed the missing English link in the broken German page and the complete three-way set in the corrected group. This is a markup test, not a test of Google's language selection.

    Google's documentation on localized versions

    What this tool is for

    Hreflang is used when a website offers equivalent pages for different languages or regions. It helps search engines understand that /de/, /en/, and /en-us/ are alternate versions of the same content, not duplicates competing against each other. This is especially relevant for companies that serve Germany, Austria, Switzerland, the UK, or the US with slightly different pages.

    The difficult part is not writing one tag. The difficult part is keeping the whole set consistent. Every localized URL should reference itself and all other matching versions. This generator focuses on that practical problem by producing HTML head tags, XML sitemap entries, or HTTP link header values from the same input.

    How to use it

    1. Add every language or regional URL that belongs to the same content group.
    2. Use correct language codes such as de, en, fr, or region-specific codes such as de-AT and en-US.
    3. Add an x-default URL if you have a global fallback page or language selector.
    4. Copy the generated format that matches your implementation: HTML, XML sitemap, or HTTP headers.
    Other use cases

    DACH service website

    Use de-AT, de-DE, and de-CH when each country has a separate page with country-specific wording, prices, addresses, or legal details.

    International SaaS homepage

    Use en as the generic English page, de for German, and x-default for the global landing page or language selection page.

    PDF or non-HTML documents

    When a resource cannot include HTML head tags, HTTP link headers can provide hreflang information from the server response.

    Important notes

    • Each page in a hreflang cluster should include return links to the others.
    • Do not mix unrelated pages in one cluster. The alternate URLs should solve the same user intent.
    • Canonical tags and hreflang should not contradict each other. Each localized page usually canonicals to itself.

    Limitations

    • Hreflang does not translate content and does not guarantee rankings in a region.
    • Incorrect language or region codes can make the implementation ineffective.
    • Large websites should still validate hreflang at crawl level after deployment.

    Sources and review context

    This page is maintained by Martin Trixner and was last reviewed on September 9, 2026. The tool output is based on public documentation and should still be tested against the target platform before production use.

    FAQ

    What does hreflang do?

    Hreflang tells search engines which language or regional version of a page should be shown to the right users.

    Do all localized pages need to reference each other?

    Yes. Each page version should reference itself and the other versions in the same set. Missing return links are a common hreflang error.

    When should x-default be used?

    Use x-default for a fallback page, such as a global homepage or language selector, when no specific language or region matches the user.

    Can hreflang fix duplicate content?

    It can clarify alternate language or regional versions, but it should not be used to group unrelated or low-value duplicate pages.

    Should hreflang go in HTML or the sitemap?

    Both can work. HTML tags are easy for smaller sites, while XML sitemap markup is often easier to maintain for large websites.

    Do pages need self-referencing hreflang?

    Yes. Each page in the set should reference itself and the other alternate versions.

    Related tools