Skip to content
epitometool

Hreflang generator

SEO & Dev publishing

Generate alternate language hreflang tags for international SEO targeting.

Updated

Locale map (lang:url per line)

Hreflang tags

Quick start

How to use hreflang-generator

Configure inputs and generate output.

  1. Step 1
    Set inputs

    Enter required fields.

  2. Step 2
    Generate

    Create output instantly.

  3. Step 3
    Use output

    Copy and apply in your workflow.

In-depth guide

Hreflang tags: serving the right language and region in search

Hreflang annotations tell search engines which language and region each version of a page targets, so a French user sees the French URL and a UK user sees the GBP-priced one. They prevent the wrong locale from ranking and reduce duplicate-content confusion across translated pages. This tool builds the reciprocal tag set in your browser.

The format: language and optional region

Each tag uses an ISO 639-1 language code, optionally plus an ISO 3166-1 region: en, en-GB, es-MX. The special value x-default marks the fallback page for users whose language you do not explicitly target. Region without language (GB alone) is invalid.

How to use this tool

  1. Add one row per locale, mapping each language-region to its absolute URL.
  2. Include an x-default entry for the global fallback.
  3. Copy the generated tag set into the <head> of every page in the group.

Reciprocity is mandatory

Hreflang only works when the references are mutual: if the English page lists the German one, the German page must list the English one back, and both must list themselves. A missing return link is the single most common reason hreflang is ignored. You can also place these as XML sitemap alternates instead of head tags — adapt the URLs accordingly.

Common pitfalls

Use absolute URLs and consistent canonicals. Pointing hreflang at one URL while canonicalising to another sends contradictory signals that Google drops.
  • Match codes to real audiences — use en-GB vs en-US only if the pages genuinely differ.
  • Validate after deploy with Search Console's International Targeting report.
  • Privacy: the tags are generated locally — your URLs are never uploaded.

When to use it vs alternatives

Use this tool for quick browser-based work when you need an answer or output immediately. Use a dedicated application or automated workflow when you need bulk processing, approvals, or repeatable production rules.

Frequently asked questions

Can I generate an x-default tag?

Yes. Add x-default as the language code to mark the fallback page for users whose language you do not explicitly target.

Should each locale reference all the alternates?

Yes. Hreflang must be reciprocal — every page in the group must list every locale including itself. A missing return link is the most common reason hreflang is ignored.

Can I use these in an XML sitemap instead of the head?

Yes. The output is HTML link-tag format, but the same URL and language values can be placed as alternate links in an XML sitemap.

What is the correct code format?

Use an ISO 639-1 language code, optionally with an ISO 3166-1 region: en, en-GB, es-MX. A region on its own (like GB) is invalid — language is always required.

Do hreflang and canonical tags conflict?

They must agree. Each language version should canonicalise to itself; pointing hreflang at one URL while canonicalising to a different one sends contradictory signals.

How do I verify hreflang is working?

Use Google Search Console's International Targeting report, which flags missing return tags and unknown language codes after the pages are crawled.

Keep exploring

More tools you'll like

Hand-picked utilities that pair well with the one you're on — all free, client-side, and zero-signup.