Hreflang Tag Generator

List each language or country version of a page and get correct hreflang annotations in all three formats Google supports — with validation of ISO 639-1 and ISO 3166-1 codes and x-default.

Runs in your browser

Page versions

LanguageRegion (opt.)URL
Shown to users whose language/region matches none of the versions.
Used to check the set contains a self-referencing tag.

Checks

    
          
    Webflow: with Webflow Localization, hreflang tags and sitemap alternates are added automatically for every locale — don’t add them again. Without Localization (e.g. separate sites per language), paste the HTML output into each page’s Page settings › Custom code › Inside <head> tag.
    Language & region code reference
    Language code (ISO 639-1)Language
    Region code (ISO 3166-1)Country / region

    Your data never leaves your computer. All processing happens 100% locally in your browser.

    How to use the Hreflang Generator

    1. Add a row for every language or country version of the page: a language code (de), an optional region code (AT) and the version’s full URL.
    2. Set an x-default URL for visitors who match none of the versions — usually your main site or a language picker.
    3. Fix anything flagged in Checks, such as en-UK (should be en-GB) or relative URLs.
    4. Copy the format you need: HTML link tags for every version’s <head>, an HTTP header for PDFs and other non-HTML files, or XML sitemap entries.

    What is hreflang?

    hreflang is an annotation that tells Google which URLs are language or regional variants of the same content, so it can show a searcher in Vienna your de-AT page instead of the US English one. It doesn’t boost rankings; it swaps the right version into the results and stops near-identical regional pages (en-US vs en-GB) from being treated as duplicates. Bing largely relies on the content-language and lang attributes instead, so set those too.

    The rules Google enforces

    • Codes: the language is an ISO 639-1 two-letter code (en, de, pt); the optional region is an ISO 3166-1 alpha-2 country code (GB, AT, BR). Region alone is invalid — hreflang="GB" does nothing.
    • Self-reference: each page must list itself as well as all its alternates.
    • Return links: annotations must be reciprocal. If page A points to B, B must point back to A, otherwise Google may ignore the pair. The easiest way is to put the identical set of tags on every version — which is exactly what this generator outputs.
    • Absolute, canonical URLs: use full https:// URLs that return 200 and are the canonical version — not redirects or noindexed pages.

    Three ways to implement it

    MethodBest forExample
    HTML <link>Most websites<link rel="alternate" hreflang="de-AT" href="https://example.com/at/">
    HTTP Link headerPDFs and other non-HTML filesLink: <https://example.com/at/doc.pdf>; rel="alternate"; hreflang="de-AT"
    XML sitemapLarge sites; keeps HTML lean<xhtml:link rel="alternate" hreflang="de-AT" href="…"/> inside each <url>

    Use one method per URL set — mixing them is allowed but multiplies the chances of contradictions.

    Common hreflang mistakes

    • en-UK instead of en-GB; en-EU or es-LA (EU and LA aren’t country codes); jp instead of ja for Japanese; cz instead of cs for Czech.
    • Pointing every language version’s canonical at the English page — that tells Google to ignore the translations.
    • Automatically redirecting visitors by IP, which can stop Googlebot (mostly crawling from the US) from ever seeing other versions.

    Check a live page’s annotations with the SEO Checker, and build the rest of your multilingual sitemap with the Sitemap Generator.

    Tools that pair well with the Hreflang Generator

    • Meta Tag Generator — Fill in one form and get a complete, valid <head> — title, description, canonical, robots, Open Graph, X/Twitter cards, theme colour and icons — with live previews and Webflow-specific output.
    • Meta Tag Checker — See exactly how Google is likely to display your page: title and description measured in pixels, desktop and mobile previews, and every meta tag in the <head>.
    • Heading Checker — Visualise the heading outline of any page.
    • Image Alt Checker — Audit every image on a page in one table: alt text status, file size, width/height attributes, format and lazy loading — with filters and CSV export.

    Frequently asked questions

    Do I need a region code in hreflang?
    Only if you have different versions per country. If you have a single German page for all German speakers, use de. Add de-AT and de-CH only when those pages actually differ (prices, spelling, legal text).
    What is x-default?
    x-default marks the fallback URL for users whose browser language or location doesn’t match any listed version — typically a language selector or your international English page.
    Is it en-UK or en-GB?
    Always en-GB. The ISO 3166-1 code for the United Kingdom is GB; “UK” is not valid and Google ignores tags using it.
    Does Webflow add hreflang tags automatically?
    Yes, if you use Webflow Localization: it outputs hreflang links for every published locale and adds them to the auto-generated sitemap. For separate Webflow sites per language, add the tags manually in each page’s custom code.
    Should every page have the same hreflang tags?
    Every page in one translation group should carry the same complete set — all versions including itself, plus x-default. Different pages (e.g. /about vs /pricing) each have their own set.

    Related tools