Hreflang Tag Generator

Generate hreflang link tags or an XML sitemap for multi-language and multi-country websites (English, Urdu, Arabic and more).

50 free uses every 24 hoursUnlimited with Pro →

Private by design — your data stays on your deviceEverything runs right here in your browser. What you type is not sent to our server and is not stored.
  • Runs in your browser
  • Not stored
  • No sign-up

The Hreflang Tag Generator creates hreflang link tags or an XML sitemap for websites that publish the same page in several languages or countries. You add each version's URL, choose its language or region, and copy the finished code. It suits site owners, SEOs and developers working with English, Urdu, Arabic and other languages.

What do hreflang tags actually do?

Say you have one page in English and the same page in Urdu. Hreflang tags tell Google that these pages are versions of each other. Google can then show the right version to the right user, based on language or country.

Without them, searchers may land on a page in a language they can't read. Writing the tags by hand is slow and easy to get wrong, especially with many languages. A generator keeps the format consistent.

How to use the Hreflang Tag Generator

  1. Add each language version. Choose the language or region from the list (28 are available) and paste the full URL of that version.
  2. Add an x-default page (optional). This is the fallback page for visitors whose language you don't cover.
  3. Pick your output. Choose HTML link tags or an XML sitemap.
  4. Copy or download. Paste the tags into every version of the page, or download the sitemap file.
How to use the Hreflang Tag Generator on OneHubTools: 4 steps with a real screenshot of the tool
How to use the Hreflang Tag Generator, step by step.

This tool pairs well with the XML Sitemap Generator. If you do this kind of job often, the Meta Tag Generator and the Keyword Combiner can save you time too.

The tool runs in your browser, so the URLs you enter are not uploaded anywhere. It is free to use.

Result from the Hreflang Tag Generator on OneHubTools
What the Hreflang Tag Generator gives you.

A quick example

Imagine a shop with an English page at example.com/en/ and an Urdu page at example.com/ur/. You would add both URLs, pick English and Urdu, and set the English page as x-default. The tool outputs one set of tags that lists both versions plus the default. Every page in the group gets that same set.

What is a hreflang generator good for?

  • Translated sites. Blogs, product pages and help articles that exist in English, Urdu, Arabic or another language.
  • Country-specific pages. The same language with different content per country, such as different prices or shipping details.
  • Site migrations. Rebuilding tags after a redesign or a change in URL structure.
  • Audits and fixes. Regenerating a clean set when your current tags are missing or inconsistent.
  • Large sites. Producing a hreflang sitemap instead of editing every page template.

HTML tags or XML sitemap: which should you choose?

OptionWhere it goesBest for
HTML link tagsInside the head of every version of the pageSmall sites and pages you can edit directly
XML sitemapUploaded to your site and submitted to GoogleMany pages, or when you can't change page templates

Pick one method and stay with it. Using both for the same pages gives you two places to keep up to date, and they can drift apart.

Tips for best results

  • List every version on every page. Each page should reference all the others and itself. If the English page points to Urdu, the Urdu page must point back.
  • Use full URLs. Include https:// and the exact address, including any trailing slash your site uses.
  • Match the language code to the content. Use the language you actually wrote, not the language you hope to target.
  • Add x-default hreflang when you have a fallback. A language-selector page or your main English page both work well.
  • Only link pages that are true equivalents. A translated product page should point to the same product, not the translated home page.
  • Update the tags when you add a language. A new version means regenerating the set and updating every existing page.

Common hreflang mistakes to avoid

Missing return links

This is the most frequent problem. Page A points to page B, but page B doesn't point back. Paste the same complete set into every version to avoid it.

Pointing to redirected or broken URLs

Each URL in your tags should load normally. Check the addresses before you generate the code.

Mixing up language and country

Language comes first, and the region is optional. A language alone covers everyone who speaks it, while a language plus region targets one country. Choose the narrower option only when the content really differs by country.

Leaving tags on only some pages

If you tag the English page but forget the Urdu or Arabic ones, the group is incomplete. Add the tags to every version.

Do I need a hreflang tag generator for a single-language site?

No. Hreflang only matters when you have translated or country-specific versions of the same page. If your site is in one language for one audience, you can skip it.

Why a generator beats writing tags by hand

One typo in a language code or URL can break the link between versions. With a hreflang generator you enter each URL once and get the same tag set for the whole group. That makes it simpler to keep every version consistent. It is a practical start for multilingual SEO on any size of site.

Limits and specs

PriceFree
Free use50 uses every 24 hours — shared with 178 other tools in the “Basic tools” group
Where it runsIn your browser
Sign-upNot needed
Muhammad Shahwaiz Gillani
Maintained and reviewed by Muhammad Shahwaiz GillaniSoftware engineer and founder of OneHubTools · Last reviewed

How we checked it: We tested it on real web pages, including pages of this site.

Learn more

According to Wikipedia, plain text contains only readable characters, with no formatting such as fonts or colours. Most text today is stored as UTF-8, which is used by over 98% of websites.

Spotted a mistake or the tool did not work for you? Tell us and we will fix it.

Rate this tool

Ratings come only from signed-in users, so every rating is verified.

Only signed-in users can rate tools, so every rating shows a ✔ Verified badge.Sign in to rate

Frequently asked questions

What is a hreflang tag?

A hreflang tag is a line of code that tells Google which language or country a page version is for. It connects translated or regional versions of the same page so the right one can be shown to the right user.

Where do I put hreflang tags?

Paste the HTML tags into the head section of every version of the page. If you prefer not to edit pages, download the XML sitemap from the tool and add it to your site instead.

Should I use HTML tags or an XML sitemap for hreflang?

Use HTML tags if you can edit each page, and an XML sitemap if you have many pages or can't change the templates. Choose one method and keep it consistent.

What is x-default in hreflang?

The x-default value marks the fallback page for visitors whose language isn't covered by your other versions. It is optional, and the generator lets you add it with one extra URL.

Do I need hreflang for a single-language site?

No. You only need hreflang when you have translated or country-specific versions of the same page.

Is the Hreflang Tag Generator free, and is my data uploaded?

Yes, it is free to use. The tool works in your browser, so the URLs you enter are not uploaded.

Related tools

All seo tools →