Hreflang generator
Hreflang tag generator
Enter the URL for each language and region version of a page. The generator writes the full set of tags, with return links and a fallback, in the format you choose.

350+businesses served
8countries
7+years
In short
Use the hreflang generator to turn a list of language and region URLs into correct tags. Add each version of a page with its code, such as en-gb or de-de, choose an x-default fallback and pick an output: HTML link tags, XML sitemap entries or HTTP headers. It writes the complete set, so every version points to every other one.
Rather have it done for you? See our technical SEO service, from $1,500.
On this page 5 sections
What the generator does
Hreflang tells search engines which version of a page suits which language and region. The rules are strict, and most errors come from a missing return link. The generator builds the whole set from one list, so each page references itself and every alternate.
It checks codes as you type. A language comes first, as a two-letter ISO 639-1 code. A region is optional and follows as an ISO 3166-1 alpha-2 code, so the United Kingdom is gb, not uk.
Inputs
| Field | Example | Note |
|---|---|---|
| Page group name | Pricing page | Only used to label the output |
| URL | example.com/uk/pricing/ | Use the full absolute URL, including the scheme |
| Language and region code | en-gb | Lowercase language, region optional |
| x-default URL | example.com/pricing/ | The page for visitors who match none of your codes |
| Output format | HTML, sitemap or HTTP header | Pick one method per site, not several |
Worked example: four versions
A company runs English pages for the United States, United Kingdom and Australia, plus a German page for Germany. For one pricing page the list is below.
| URL path | Code |
|---|---|
| /us/pricing/ | en-us |
| /uk/pricing/ | en-gb |
| /au/pricing/ | en-au |
| /de/preise/ | de-de |
| /pricing/ | x-default |
The generator outputs five tags and places them on all four regional pages and on the default page. Each page therefore carries all five. The German page links back to the three English pages, and each English page links to it. That mutual linking is what search engines check.
Which output to choose
- HTML link tags in the head: simplest for small sites and easy to inspect.
- XML sitemap entries: better for large sites, because the pages stay lighter and one file holds the whole map.
- HTTP headers: the only option for files that have no head, such as PDFs.
Use one method. Mixing methods invites conflicts, and a conflict can lead engines to ignore the signal.
Common mistakes the generator flags
- A page that does not reference itself
- A missing return link from an alternate
- Invalid codes, such as en-uk or an underscore instead of a hyphen
- An alternate URL that redirects, returns an error or is blocked by robots.txt
- A canonical tag pointing to a different language version
Hreflang is a hint rather than a command, and it works when each version is genuinely localized. For planning the structure, see international SEO and the international SEO checklist. More checks to build into your release process are in SEO tools for web developers.
Updated 20 November 2026
Questions, answered
Something else on your mind? Ask us directly or WhatsApp us. We reply within one working day.
Do I need x-default?
Can I use hreflang for language only?
Does hreflang improve rankings?
How do I check that it worked?
How do I generate hreflang tags?
Which language and region codes should I use?
Keep exploring
International SEO: one site, several countries, no cannibalization
Selling in more than one country or language means search engines must know which page belongs to which audience. We set that up and prove it works.
ChecklistInternational SEO checklist
Going international is a structure decision first and a translation job second. Get the URLs, hreflang and market signals right and the rest follows.
Free toolSchema markup generator
Pick a type, fill in the fields that match your page, and copy valid JSON-LD. The generator leaves out empty fields so you never publish a blank…
Running a multi-region site?
We review the full setup and give you a fixed quote after a short call.








