SEO Tools

Hreflang Tag Generator

Create alternate language tags from a simple language and URL list. Useful for GitHub Pages, static sites, blogs, documentation sites, and small business websites with translated pages.

Loading tool...

What is Hreflang Tag Generator?

A hreflang tag tells search engines which language or regional version of a page should be shown to a visitor. It is most useful when the same content exists in English, Spanish, Chinese, Japanese, or another language. Static site owners often need these tags because GitHub Pages and simple HTML exports do not create them automatically.

How to use this tool

  1. Enter one language and URL pair per line, using the format language-code|absolute-url.
  2. Add an x-default URL if you have a global landing page or language selector.
  3. Copy the generated tags into the head section of every equivalent language page.
  4. Make sure each translated page includes the full hreflang set, including itself.

What you can use it for

  • Add alternate language tags to static HTML pages.
  • Check language URL pairs before publishing.
  • Create an x-default URL for language selector pages.

Use cases

Practical examples

Example

Three-language documentation page

A docs page has English, Spanish, and Chinese versions. Add all three URLs to the tool and paste the generated tags into each version so search engines can connect the translated pages.

Example

GitHub Pages language folders

A static site uses /en/, /es/, and /ja/ folders. This tool helps create the exact alternate tags without writing each link tag by hand.

Common mistakes

  • Using a language code that does not match the actual page language.
  • Forgetting to include the current page in the hreflang set.
  • Pointing hreflang tags to redirected or canonicalized URLs.

FAQ

Questions about Hreflang Tag Generator

Should every language page include the same hreflang list?

Yes. Each equivalent page should link to every alternate version, including itself. This reciprocal pattern helps search engines understand the full language group.

Do I need x-default?

Use x-default when you have a general page, region selector, or fallback page that is not aimed at one specific language or country.

Can I use relative URLs in hreflang tags?

Absolute URLs are safer and easier to audit. Use the final public URL that visitors and search engines can access.

Related tools

More seo tools