Rankite
ServicesResultsToolsTeamAboutBlogCareersContactFree SEO Audit
Free tool

Hreflang Tag Generator: Multi-Language SEO Tags

Paste your language-region URLs and get a clean, mutually-referencing set of hreflang tags ready to drop into your head, instantly and free.

Home / Tools / Hreflang Tag Generator

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.

What is hreflang and how is it written?

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.

Hreflang rules and x-default

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.

Common hreflang mistakes to avoid

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.

Related articles

FAQ

Hreflang Tag Generator: questions, answered

What is the hreflang tag used for?
The hreflang attribute tells Google which language and regional version of a page to serve to which users. If you have a page in English, Spanish and German, hreflang links those versions together so a searcher in Madrid sees the Spanish URL and a searcher in Berlin sees the German one, instead of the wrong language or duplicate-looking pages competing against each other.
What format should the hreflang value be?
Use an ISO 639-1 language code on its own, like en or es, or a language plus an ISO 3166-1 Alpha 2 region code, like en-US or es-ES. The language comes first, then an optional region after a hyphen. Region alone is not valid, and codes are not case sensitive but lowercase-language, uppercase-region is the convention.
Do hreflang tags need to be reciprocal?
Yes. Every page in the set must link to every other page, including itself, and those return tags must point back. If your English page lists the Spanish URL but the Spanish page does not list the English URL, Google ignores the annotation. The generator above outputs the full mutually-referencing block so the return tags are never missing.
What is the x-default hreflang value?
x-default is the fallback version shown to users whose language or region does not match any of your specific hreflang entries. It is commonly used for a global landing page or a language selector. It is optional but recommended when you serve many regions and want one safe default for everyone else.
Where do hreflang tags go on the page?
Place the link elements in the head of each HTML page. You can also deliver the same annotations through HTTP headers or an XML sitemap, but the head method is the most common and the easiest to audit. Whichever method you choose, use only one method per page and keep the URLs absolute.

More free tools

Let's grow

Ready to own page one?

Get a free, no-obligation SEO audit and a 30-minute strategy session. We'll show you exactly where the growth is hiding.

Book your free audit Explore services
Get in touch

Tell us about your project

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.

Or copy our email and write to us directly: contact@rankite.com