Type a tool name, for example "keyword density" or "transcript".
Generate hreflang tags for international SEO. Add language/region pairs and copy ready-to-paste markup.
Optional. Used as the fallback for users whose language/region does not match any other tag.
A hreflang tags generator builds the language and region annotations that tell Google which version of a page to show each searcher. With this free tool, you enter a language code and URL for each version, add an optional x-default fallback, and copy ready-to-paste HTML link tags or an XML sitemap fragment.
A hreflang tag is an annotation, written as rel="alternate" plus an hreflang value, that tells search engines which URL serves which language or region. Its job is matching: a searcher in Germany who types in German should see your German page, not your English one.
Each value has up to two parts. The first is a language code such as en, es or de. The second, optional part is a region code such as US, GB or MX, joined with a hyphen (en-GB). A special value, x-default, marks the fallback page for everyone who matches none of your listed versions.
Hreflang does not boost rankings by itself. Google's Search Central documentation describes it as a way to help the right localized version appear, and to reduce the chance that near-identical pages in the same language compete with each other.
Google accepts hreflang in the HTML head, in HTTP headers, or in an XML sitemap. All three are treated the same, so pick the one you can maintain. This generator outputs the first and last: link tags for the head and a sitemap fragment.
You only need your page versions and their full URLs. The output updates as you type, so there is no submit button.
en-US or fr-CA. In the right box, enter the full URL of that version.Say you run a store with a US English page, a UK English page and a German page, plus a global homepage as the fallback. You would enter this:
https://example.com/en-US and https://example.com/en-us/en-GB and https://example.com/en-gb/de-DE and https://example.com/de/The Generated HTML box then shows one link line per entry, including the x-default line, for example <link rel="alternate" hreflang="x-default" href="https://example.com/" />. The XML box shows the same set formatted for a sitemap.
What this means in practice: paste the identical set of lines into the head of all four pages. The US page lists itself, the UK page, the German page and the fallback. The UK page lists the same four. That mutual listing is what search engines call reciprocal, or return, links, and it is the most common thing people get wrong.
The issues list under the output flags the input problems that most often break hreflang. No messages means the rows are complete, but it does not prove the live pages are set up correctly.
| Message | What it means | Fix |
|---|---|---|
| Missing language code | A row has a URL but no code | Pick a code such as en-US |
| Missing URL | A row has a code but no address | Enter the full page URL |
| URL should start with http:// or https:// | The address is relative or incomplete | Use the full absolute URL |
| Duplicate language code | Two rows use the same code | Keep one URL per code |
A good result has one row per version, absolute https URLs, no repeated codes and an x-default that points to a real fallback page. A poor result has gaps, relative paths such as /de/, or the same code used for two different pages.
Use a language-only code when one page serves every speaker of that language, and add a region only when the content truly differs. A single Spanish page for everyone is es. Separate pages with different currency, shipping or spelling are es-MX and es-ES.
These mistakes show up constantly:
US alone is invalid. Write en-US.GB, so en-UK is wrong. Write en-GB.pt-BR, not pt_BR.de, not german.The suggestion list covers common codes, including Chinese variants (zh-CN, zh-TW, zh-HK) and Portuguese variants (pt-PT, pt-BR). You can also type a code that is not listed.
Choose HTML link tags for small sites and XML sitemap entries for large ones. A site with 3 languages and 20 pages is easy to manage in the head. A catalog with 40,000 URLs and 8 languages is easier to maintain in one generated sitemap file.
Do not mix methods carelessly. If the head and the sitemap disagree, you create conflicting signals that are hard to debug. Pick one method per set of pages.
The XML box produces the fragment for a single page and its alternates. Repeat the process for each page in your sitemap, and make sure your sitemap file declares the xhtml namespace if it does not already.
Anyone who publishes the same content for different languages or regions benefits. Typical situations include:
The tool also suits quick tests. Enter two versions, copy the output and compare it with what your site currently prints.
Most hreflang failures come from the setup around the tags, not the tags themselves. Work through this list when results look wrong.
If the wrong version still appears in search, remember that Google recrawls pages on its own schedule. Changes can take days or weeks to show.
This generator builds markup from the rows you type. It does not crawl your site, confirm that your URLs load, or check that each page already carries the return links. It also does not translate content or decide which regions deserve their own page.
Hreflang is a signal, not a command. Google may still show a different version when other signals, such as a strong local link profile or a mismatched canonical, point elsewhere. Treat the tags as one part of a broader on-page setup, and browse the on-page SEO and meta tags tools for related checks.
Ready to build yours? Add your versions above, fix any flagged rows, and copy the HTML or XML straight into your site. Then paste the same set on every page in the group.
Your report has been submitted. We will look into this issue.
A VPN changes your network exit. It does not guarantee anonymity.
Themes, plugins, code, video, audio, graphics & more from 90,000+ authors.
Web Development
Design & Media
Unlimited Access
Explore Envato Market