Skip to content
toolsbox

Hreflang Generator & Checker

Build valid hreflang tags, then audit a live URL for return links, canonicals and bad codes.

  • Free
  • No sign-up

What is an hreflang generator and checker?

Hreflang annotations tell search engines which version of a page to show to users in a given language or region. If you publish the same product page in US English, UK English and German, hreflang lets Google swap in the right URL for each searcher instead of showing the wrong version or treating the pages as unrelated duplicates. This tool does two jobs: it generates correct hreflang markup, and it checks live pages for the errors that cause Google to ignore annotations.

The Generate tab builds annotations from rows of language, optional region and URL, plus an x-default fallback. Languages use ISO 639-1 codes such as en, de or ar, and regions use ISO 3166-1 alpha-2 codes such as US, GB or AE. You can output the set as HTML link tags for the page head, as xhtml:link entries for an XML sitemap, or as an HTTP Link header for PDFs and other non-HTML files.

The Check tab audits an existing implementation. Enter a URL and the tool fetches the page, extracts hreflang from both the HTML and any HTTP Link headers, then fetches every alternate it finds, up to 25, and tests each one. Results appear as a matrix of pages against checks, so a single broken return link or conflicting canonical stands out immediately.

How to generate and check hreflang tags

  1. 1

    Add a row for each version

    In the Generate tab, enter a language code, an optional region code and the absolute URL for every language or regional version, including the page you are on. Use language-only codes like es when one page serves all speakers of that language.

  2. 2

    Set an x-default

    Add the URL to show when no listed language or region matches the user, typically a language selector or your main international page.

  3. 3

    Fix inline warnings

    Codes are validated as you type. Correct anything flagged, such as en-UK, a region code entered alone, duplicate codes or relative URLs, before copying the output.

  4. 4

    Choose an output format and deploy

    Copy HTML link tags, sitemap entries or an HTTP Link header. Place the same complete set on every version of the page, since each page must list all alternates including itself.

  5. 5

    Verify with the checker

    After deploying, run any one version through the Check tab. Review the matrix for missing return links, redirects, noindex tags and canonical conflicts across the whole cluster.

When to use the hreflang tool

Launching a new language or market

Generate a full annotation set when adding a new locale, so every existing page gains a link to the new version and the new version links back to all of them.

Fixing the wrong country version ranking

If UK searchers land on your US pricing page, check whether hreflang is missing, one-directional or contradicted by canonical tags pointing at the US URL.

Auditing after a migration or CMS change

URL changes often break hreflang silently: alternates start redirecting or return 404s. The checker fetches each alternate and flags anything that is not a direct 200.

Serving Gulf and multilingual markets

Sites targeting the UAE often run English and Arabic versions side by side, such as en-AE and ar-AE. The generator keeps the codes valid and the set consistent across both.

Adding hreflang to PDFs

Non-HTML files cannot carry link tags. Use the HTTP Link header output and add it to your server configuration for each translated document.

The hreflang mistakes this tool catches

Invalid codes are the most common error. The UK's ISO code is GB, so en-UK is wrong and should be en-GB. A region on its own, such as US, is not valid; the language always comes first. Google does not support es-419, the UN M.49 code for Latin American Spanish, so use es as the general Spanish version or list specific countries like es-MX and es-AR.

Missing return links are the next most frequent problem. Hreflang must be reciprocal: if page A lists page B as an alternate, page B must list page A. Google may ignore annotations that are not confirmed by the other side. Each page should also include a self-referencing hreflang entry for its own language and region.

Canonical conflicts undermine everything else. Each language version should have a canonical tag pointing to itself. If the German page's canonical points to the English page, you are telling Google the German page is a duplicate to be folded into the English one, which contradicts the hreflang signal. Similarly, an alternate that is noindexed, redirects or returns an error cannot be shown to anyone.

Hreflang is a hint for choosing between versions you already have, not a ranking boost. Every alternate must be indexable on its own merits, and URLs must be absolute, including the protocol, so the annotations can be resolved without guessing.

Frequently asked questions

Is the hreflang generator and checker free?

Yes, both the hreflang generator and checker are free with no account required. The Generate tab runs entirely in your browser with no limits. The Check tab fetches live pages from our server, so it is rate-limited, but auditing a cluster of up to 25 alternates per run covers most international sites comfortably.

What do you fetch, and is anything stored?

We fetch only the public URL you enter and the alternate URLs listed in its hreflang annotations, up to 25. Pages are analyzed in memory and the results are sent back to your browser; nothing is stored. Requests are rate-limited, and private or internal network addresses are blocked for security.

Why is en-UK wrong?

The en-UK code is wrong because the ISO 3166-1 alpha-2 code for the United Kingdom is GB, not UK. Google expects valid ISO codes, so en-UK may be ignored entirely, leaving British users without a targeted version. Use en-GB instead. The generator flags this mistake as you type.

Do I need an x-default hreflang?

An x-default is not required, but it is strongly recommended for any multilingual site. It tells search engines which URL to show when a user's language or region matches none of your listed versions. Most sites point x-default at a language selector page or their primary international version.

Should I use HTML tags, a sitemap or HTTP headers?

Any of the three methods works, and Google treats them equally, so choose the one you can maintain most reliably. HTML link tags are easiest for small sites. XML sitemaps keep page heads lighter and suit large sites with many locales. HTTP Link headers are the only option for PDFs and other non-HTML files. Avoid mixing methods for the same pages.

Can I use hreflang across different domains?

Yes, hreflang works across domains, subdomains and subfolders alike. A cluster can include example.com, example.de and fr.example.com, as long as every page lists all alternates and each alternate links back. Cross-domain setups need the same reciprocity and self-referencing rules, and each domain must allow the pages to be crawled and indexed.

Related tools

More SEO tools →