Hreflang tag generator
Build valid, reciprocal hreflang annotations for your international site - as HTML tags, sitemap entries, or HTTP headers, with x-default and live validation.
- No signup required
- 3 output formats
- Live validation
Language versions
x-default tells search engines which page to serve when no language matches.
3 alternates
<link rel="alternate" hreflang="en" href="https://example.com/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/" />
Place this full set of tags in the <head> of every listed page (each page must reference all alternates, including itself).
Valid hreflang set with 3 alternates (including x-default).
Don't forget reciprocal tags
hreflang must be reciprocal: every page in the set must link to all the others (and itself). If your English page points to the French one, the French page must point back - or Google ignores the annotations. The set above is the full reciprocal block to place on every listed page.
Launching a multilingual site?
International SEO is easy to get subtly wrong. We build multilingual sites with correct hreflang, sitemaps, and structure from the start.
Talk to an engineerQuick answer: Hreflang tags tell search engines which language and regional version of a page to serve to which users.
This generator builds valid, reciprocal hreflang markup - as HTML link tags, XML-sitemap entries, or HTTP headers - including the x-default tag, so Google serves the right page to the right audience and you avoid duplicate-content issues.
The three ways to implement hreflang
| Method | Best for |
|---|---|
| HTML link tags | Most sites; simple to add to each page's <head> |
| XML sitemap | Large sites; keeps markup off the page and scales well |
| HTTP Link header | Non-HTML files like PDFs |
Pick one method per set of URLs - don't mix HTML tags and sitemap entries for the same pages.
Language & region code examples
| hreflang | Targets |
|---|---|
| en | English speakers, any region |
| en-US | English speakers in the United States |
| en-GB | English speakers in the United Kingdom |
| fr-CA | French speakers in Canada |
| x-default | Fallback when no language matches |
Language uses ISO 639-1 (2 letters); region uses ISO 3166-1 Alpha-2 (2 letters). Language is required, region is optional.
The most common hreflang mistakes
- Missing return (reciprocal) tags - every page must reference all the others, or Google ignores the set.
- Wrong codes - using a country code as a language (e.g. "uk" for Ukrainian, which is actually "ua" region / "uk" language is Ukrainian - easy to confuse) or inventing codes.
- No x-default - leaving users with no fallback when their language isn't covered.
- Relative URLs - hreflang requires absolute, fully-qualified URLs.
- Non-canonical targets - hreflang URLs should be self-canonical, not pointing at a different canonical.
Try these next
Browse all SEO tools- XML Sitemap GeneratorPaste URLs, get a valid sitemap.xml
- Robots.txt & AI Crawler CheckerControl GPTBot, Google-Extended & more
- Structured Data CheckerValidate schema & rich results
- SERP Snippet PreviewSee your page in Google before you publish
- DNS Lookup & CheckerCheck any domain's DNS records instantly
- Domain Age & WHOIS CheckerHow old is any domain?
Guides on this topic
Your questions, answered
Have a question about your project? Ask us on a free call, and we'll give you a straight answer.
What are hreflang tags?
What is the x-default hreflang value?
Should hreflang go in the HTML, sitemap, or HTTP header?
Do hreflang tags need to be reciprocal?
What language and region codes does hreflang use?
What is x-default?
HTML, sitemap, or HTTP header?
Which codes does hreflang use?
Tell us about your project
Tell us what you're building, when you need it, and what's in the way. A senior engineer will reply within one business day with honest next steps, even if that means we're not the right fit.
- Your project is led by a senior engineer, not a junior and not AI on its own
- AI speeds up the build. Every change is reviewed and tested before it ships
- Best for MVPs, SaaS products, automation, and fixing apps that keep breaking
