Hreflang Generator
Generate hreflang link tags for multilingual and regional versions of a page.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the hreflang generator
- Add each language version with its code and URL.
- Set x-default for everyone else.
- Put the whole set in every version's <head>.
About this tool
hreflang tells search engines that several pages are the same content in different languages, so the right one is shown to each user rather than the wrong one being treated as duplicate content.
The rule that catches everyone out is reciprocity. Every page in the set must list every version, including itself. If page A points at B but B does not point back, search engines discard the annotation entirely — a half-implemented hreflang set achieves nothing rather than something.
Codes are a language, optionally with a region: <code>en</code>, or <code>en-GB</code>. The region part is a country, not a language, which is why <code>en-UK</code> is wrong and <code>en-GB</code> is right — a genuinely common mistake.
x-default names where users of any unlisted language should go, typically a language selector or the international version.
Common uses
- A site published in several languages.
- Regional variants such as en-GB and en-US.
- Pointing unmatched visitors at a language selector.
Frequently asked questions
- Does each page need the full set of tags?
- Yes. Every version must list every version including itself. Without that reciprocity the annotation is ignored completely.
- Is en-UK valid?
- No. The region is an ISO country code, and the United Kingdom's is GB. Use en-GB.
- What is x-default for?
- Users whose language matches none of your versions. It usually points at a language selector or the international edition.
Related tools
Canonical URL Generator
Generate a rel=canonical link tag, with a check that the URL is suitable.
Open Graph Generator
Generate Open Graph meta tags so links to your page preview correctly when shared.
Meta Tag Generator
Generate title, description, canonical, Open Graph and Twitter Card tags with live length checks.
XML Sitemap Generator
Turn a list of URLs into a valid XML sitemap with lastmod and optional fields.