The fallback URL for users whose language/region isn't targeted. Usually your main page.
What is a hreflang tag generator? A hreflang tag generator writes the alternate-language markup that tells search engines which version of a page suits each language or region. You enter an x-default URL and one URL per language, pick language codes from a list of 46, and the tool outputs HTML link tags, XML sitemap entries and an HTTP Link header.

What is a hreflang tag generator?

If your site has the same page in several languages, such as English, French and German, Google needs a signal about which version to show to which user. That signal is hreflang. Each version lists all versions, including itself, with a language code. Get one entry wrong and the set stops working.

This hreflang tag generator keeps the work simple. Put your fallback page in Default / Canonical URL (x-default). Then fill the rows: one URL and one language per row, chosen from a dropdown of 46 languages and regional variants such as en-GB, fr-CA and pt-BR. Click + Add Language/Region URL for more rows, or Load Example to see a sample. The code updates as you type once there are two or more entries.

Use the three tabs to pick a format: HTML <head> Tags, XML Sitemap or HTTP Headers. A validation box warns about duplicate languages and a missing x-default. It cannot check your live pages, so it cannot tell you whether the return links are actually in place on each URL.

How to generate hreflang tags

  1. Enter your fallback page in Default / Canonical URL (x-default), for example https://example.com/page.
  2. In the first row, paste the page URL and choose its language from the dropdown. Rows start with English and French selected.
  3. Click + Add Language/Region URL for each extra version. Use Remove to delete a row.
  4. Or click Load Example to fill English, French (France) and German (Germany) rows.
  5. Pick a tab: HTML <head> Tags, XML Sitemap or HTTP Headers, then click Copy Code.
  6. Read the Validation Summary, then add the same full set of tags to every page in the group.

What this hreflang tag generator includes

Three output formats

Link tags for the head, xhtml:link entries for an XML sitemap, and a Link header for non-HTML files such as PDFs.

46 language options

The list includes regional variants like en-US, en-GB, es-MX, pt-BR, zh-CN and zh-TW, shown with their names and codes.

x-default support

The default URL is written as hreflang="x-default" in all three formats.

Live output

Code appears once you have two entries and updates with every change.

Validation summary

Warns about repeated language codes, a missing x-default, or fewer than two language variants.

Add and remove rows

Create as many language rows as you need.

Who uses it, and for what

  • Multilingual business sites. A company with English, French and German pages generates one block and pastes it on all three.
  • Shops with regional stores. Separate en-US, en-GB and en-AU product pages can be linked with the right regional codes.
  • Large sites using sitemaps. Instead of editing every page head, generate sitemap entries in the XML tab and merge them into your sitemap.
  • SEO consultants. Draft the markup for a client, then check page titles and tags with the Meta Tag Analyzer and the redirects with the Redirect Checker.

Tips and common hreflang mistakes

  • Every page in the set must list every alternate, including itself. Paste the same block on each page, or hreflang may be ignored.
  • Use full URLs with https://, and make sure they are the final addresses, not redirects.
  • Use one tag per language-region combination. Do not repeat a code. The tool warns you if you do.
  • Language codes come first, then an optional region: en-GB is right, GB-en is not.
  • Hreflang points to alternate versions of the same content, not to different pages on the same topic.
  • Pick one method. Using head tags, sitemap and headers together for the same pages is more work and can cause conflicts.

Is it safe? Privacy and limits

The code is built in your browser from the URLs and language choices you enter. Nothing is sent to a server and the tool does not visit your pages, so it cannot check whether they exist or link back to each other. URLs are written as typed, and special characters like ampersands are not escaped, so check them in the XML. Review the output before publishing it.

Hreflang tag generator FAQ

A hreflang tag is an annotation that tells search engines which language, and optionally which region, a page is for, and where to find the other versions. It looks like a link element with rel="alternate" and hreflang="fr". Google uses it to show the right version to the right user. It is a signal, not a command, and it helps with duplicate-looking content across versions like en-US and en-GB.

X-default is a special hreflang value for the fallback page, used when no other language or region matches the user. It is often a language selector page or your main version. In this tool, you fill it in the Default / Canonical URL field and it is written as hreflang="x-default". Adding one is recommended, and the validation box warns if you leave it empty. It does not replace the language entries.

Any one of the three works. HTML link tags in the head are the simplest for a few pages. An XML sitemap is easier on big sites because you do not edit each page. HTTP headers are for non-HTML files such as PDFs. Choose a single method per set of pages. This tool produces all three from the same input, so you can switch tabs and copy whichever suits your setup.

Search engines only trust a pair of pages if each points to the other. If page A lists B but B does not list A, the annotation may be ignored. In practice, every page in the group must carry the full set of tags, including a self-referencing one. Generate the block once and paste the same code on each version. The tool cannot check this on your live site, so confirm it yourself after publishing.

Use ISO 639-1 language codes, such as en, fr or de, optionally followed by an ISO 3166-1 region code, like en-GB or pt-BR. Only add a region if you really have separate pages for it. If your French page serves all French speakers, use fr alone. The dropdown has 46 options, including some regional pairs. Chinese is offered as zh, zh-CN and zh-TW.

The output only shows once there are at least two entries. The x-default URL counts as one, so with x-default set you need one filled language row, or two language rows without it. Rows with an empty URL are ignored. Fill in the URL fields, not just the dropdowns. Also note the validation box separately warns if you have fewer than two language variants, which is a stricter check.

No. It produces a complete sample urlset with one url block per language, each holding all the alternate links. You can copy the url blocks into your existing sitemap, and make sure the xhtml namespace is declared on the urlset element, as in the example. The x-default URL appears as an alternate link, but it does not get its own url block unless it is also one of your language rows.

Yes, it is free, with no account and no limit on rows or copies. It runs in your browser. After publishing, check your pages by viewing the source or running a crawler. You can also check that final URLs do not redirect with the Redirect Checker. Search engines may take a while to process new hreflang annotations, so do not expect instant changes in results.