Hreflang tag generator
Hreflang tells search engines which language or regional version of a page to show each searcher. Add each version’s language code, with an optional region such as en-GB or es-419, and its full URL, plus an x-default page for everyone else. The generator checks every code against ISO language and region lists and shows its readable name, catches common mistakes such as en-UK instead of en-GB, a country code on its own, duplicate codes or URLs and relative links, and outputs the annotations as HTML link tags, an HTTP Link header or XML sitemap entries.
English
English (United Kingdom)
Spanish
Shown to searchers whose language isn’t listed.
No problems found.
Put the same complete set on every version of the page.
How to use the Hreflang Tag Generator
- 1
Add each version
Language (and optional region) code and the full URL.
- 2
Set x-default
The page for languages you don’t cover, often a language picker or the main version.
- 3
Choose a format
Link tags for the <head>, a Link header for PDFs, or sitemap XML.
When to use it
- Launch a site in several languages.
- Target the same language in different countries (en-US, en-GB, en-AU).
- Fix hreflang errors reported in Search Console.
Limits
- The same full set of tags must appear on every version of the page; the tool generates the set, you place it on each page.
- It doesn’t fetch your pages to confirm the return links exist.
Privacy
Generated in your browser; nothing is sent.
Frequently asked questions
Does every page need to list itself?
Yes. Each version includes a tag for itself and for every other version, and every version must link back, or search engines may ignore the annotations.
Why is en-UK wrong?
Region codes are ISO 3166-1. The United Kingdom is GB, so English for the UK is en-GB.
Can I use only a country code?
No. hreflang always starts with a language. Use de-AT for German speakers in Austria, not AT.
What is x-default for?
It names the page for searchers whose language or region doesn’t match any version, such as a global English page or a language chooser.
HTML tags, header or sitemap?
Any one method is enough. HTML tags are simplest; sitemaps suit large sites; HTTP headers are for non-HTML files such as PDFs.
Are hreflang URLs case-sensitive?
URLs must match exactly the URLs you publish, including trailing slashes and protocol.
Related tools
- XML Sitemap GeneratorPaste URLs and get a valid sitemap.xml, split automatically for big sites.
- Canonical URL CheckerCheck a page’s rel=canonical tag, where it points and whether the target is a working page.
- Meta Tag GeneratorTitle, description, Open Graph and X tags with a live search preview.
- Hreflang CheckerValidates hreflang tags and checks that every alternate page loads and links back.
People also use
- Robots.txt Generator & TesterBuild a robots.txt, block AI crawlers, and test URLs against the rules.
- Keyword Density CheckerMost frequent words and phrases in your text, with density.
- UTM BuilderTag links with UTM parameters for Google Analytics.
- ROAS CalculatorReturn on ad spend, ACoS, break-even ROAS and profit after ads.
Last updated November 24, 2026 · How we build and test our tools