Hreflang Tag Generator
Generate hreflang link tags for multilingual and multi-region pages. Free tool with x-default support and automatic character escaping.
Independently verified for accuracy
Calculator by Toolsloft ↗List each language version of a page with its URL and get the full set of hreflang link tags for the head. Use it on multilingual or multi-region sites so search engines serve the right language version to the right visitor. Add an x-default row for the fallback page.
How this is calculated
Each row becomes a rel="alternate" link element with hreflang and href attributes, following the multilingual annotation format documented by Google. Blank rows are dropped, URLs are required to be absolute, and reserved HTML characters in the attribute values are escaped.
How to use
- Enter a language or region code and its page URL on each row.
- Add an x-default row for the fallback URL if you have one.
- Copy the generated link tags into the <head> of every language version.
Examples
- English and Spanish:
en, es, x-default - Region targeting:
en-us for the US page
FAQ
- What is x-default for?
- The x-default value marks the page shown when no other language or region matches the visitor, usually a language selector or your main version.
- Do all pages need the same tags?
- Yes. Every page in the set should list every language version, including a self-referencing tag, so the annotations are reciprocal.
- What format should the codes use?
- Use an ISO 639-1 language code, optionally with an ISO 3166-1 region, such as en or en-us. This tool passes the code through as you enter it.