Free Hreflang Tag Generator

Generate hreflang tags for multilingual and multi-regional websites. Add language/country rows, toggle x-default, and export as HTML link tags or XML sitemap format. 100% browser-based.

Output format
2 tags will be generated + x-default

Tip: Paste the HTML tags inside the <head> of each page variant. Each page should reference all language/region variants — including itself — using hreflang tags.

Used by 3,000+ SEO pros
Zero server calls — fully client-side
5.0/5 rating

What Are Hreflang Tags?

Hreflang tags signal to Google and other search engines which language and region each version of your page targets. Without them, search engines may show the wrong language version to users or flag your pages as duplicate content.

International SEO

Ensure each user lands on the correct language version of your page, improving engagement and reducing bounce rate.

Avoid Duplicate Content

Tell Google that your French and English pages are intentional variants — not duplicate content that should be consolidated.

x-default Fallback

Set a default page for users whose language or region has no matching variant, preventing them from landing on an irrelevant locale.

Example hreflang tags<link rel="alternate" hreflang="en-us" href="https://example.com/" /> <link rel="alternate" hreflang="fr-fr" href="https://example.com/fr/" /> <link rel="alternate" hreflang="de-de" href="https://example.com/de/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/" />

Paste these inside the <head> of each language variant.

How to Use the Tool

Generate correct hreflang tags in under a minute.

1

Add Languages

Click "Add Language" to add a row for each language/region variant of your page.

2

Enter URLs

For each row, enter the full URL, select a language, and optionally select a country.

3

Choose Format

Toggle between HTML link tags (for <head>) or XML sitemap format for your sitemap file.

4

Copy & Paste

Copy the generated tags and paste them into the <head> of each page variant.

What People Are Saying

Feedback from international SEO practitioners.

Finally a hreflang generator that handles both HTML and XML sitemap format. I use the XML output for our large e-commerce site and it saves hours.

YN
Yuki N.
International SEO Manager

The country dropdown is comprehensive. I work with a lot of Spanish-speaking markets and having es-mx, es-ar, es-co etc. all available is exactly what I need.

SR
Sofia R.
SEO Consultant

The x-default toggle is a nice touch. Most generators I've used either always include it or never do. Having control over it makes implementation cleaner.

TH
Thomas H.
Technical SEO Lead

Frequently Asked Questions

What are hreflang tags?

Hreflang tags are HTML attributes that tell search engines which language and regional version of a page to serve to users based on their location and browser language settings. They prevent duplicate content issues and ensure the correct version of your content appears in search results.

What is x-default?

The x-default hreflang value marks the fallback page that search engines show when no other language or region variant matches the user's settings. It's typically set to the English or universal version of a page.

Where do I put hreflang tags?

Hreflang link tags go inside the <head> section of each page. Every page in the set should include hreflang tags pointing to all variants — including itself. This self-referential requirement is important for Google to correctly process the signals.

What is the difference between HTML tags and XML sitemap format?

HTML link tags are placed in each page's <head> element. The XML sitemap format allows you to declare all hreflang relationships in a single sitemap file, which is useful for large sites. Both approaches are supported by Google.

Should I use language-only or language-country codes?

Use language-only codes (e.g. hreflang='en') when you want to target all speakers of a language globally. Use language-country codes (e.g. hreflang='en-us') when you have different content for different regions — for example, pricing in USD vs GBP.

Is this tool client-side?

Yes. All tag generation happens in your browser. No data is sent to a server.

Full SEO Automation Available

Rank Higher Without
The Manual Work

LazySEO automates keyword research, content creation, and publishing — so you dominate Google and AI search results without spending hours on SEO.

No credit card required