Add one locale per line. Codes should look like en or en-US.
Built by Rankite, the SEO team behind Swordfish AI's +400% revenue and Zluri's +45% organic growth. See the case studies
Hreflang is an HTML attribute that tells search engines which language and regional version of a page to show which users. Add it to a page's head, point each version at the others, and a searcher in Mexico lands on your Spanish URL while a searcher in France lands on your French one. The generator above builds the full, mutually-referencing set for you so nothing is missing.
Hreflang lives inside a link element: <link rel="alternate" hreflang="en-US" href="https://example.com/" />. The value is a language code, optionally followed by a region. Language codes follow the ISO 639-1 standard (en, es, de), and region codes follow ISO 3166-1 Alpha 2 (US, GB, MX). The language always comes first; a region on its own, like US with no language, is not valid.
You can serve these annotations three ways: link elements in the head, HTTP headers (useful for non-HTML files like PDFs), or an XML sitemap. The head method is the most common and the easiest to audit, which is what this tool produces. Pick one method per page and keep every URL absolute, including the protocol.
The rule that trips up most sites is reciprocity: hreflang annotations must be mutual. If page A links to page B with a hreflang tag, page B must link back to page A. Each page should also reference itself. When return tags are missing, Google treats the whole set as unreliable and falls back to its own guess, so the effort is wasted.
The x-default value is your safety net. It marks the page shown to users whose language and region match none of your specific entries, which is ideal for a global homepage or a country selector. It is optional, but when you serve many markets it gives everyone else a sensible default instead of a near-miss. The checkbox above adds it for you.
Three errors account for most broken implementations. The first is missing return tags, covered above. The second is wrong codes: writing en-UK instead of en-GB, using a language that is not ISO 639-1, or putting a region where a language belongs. The validator in this tool flags codes that do not match the xx or xx-XX pattern before you ship them.
The third is mixing hreflang up with canonical tags. A canonical on a localized page must point to itself, not to the original-language version, or you tell Google to drop the translation entirely. Hreflang and canonical work together, but each language version is its own canonical. For a full review of an international setup against your live rankings and crawl data, request a free SEO audit and we will check it for you.
If you would rather have experts run it, see Rankite's technical SEO audit and monthly SEO management.
Build a clean robots.txt that controls crawler access and points to your sitemap.
Turn any title into a clean, SEO-friendly URL slug with the right separators.
Create valid FAQPage JSON-LD from your questions and earn rich results.
Get a free, no-obligation SEO audit and a 30-minute strategy session. We'll show you exactly where the growth is hiding.
Fill out the form and we'll get back to you within one business day. Prefer email? Write to us directly at contact@rankite.com.