SEO Tools

Free 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 sites often need these tags because GitHub Pages and simple HTML exports do not create them automatically.

quickAnswer

Use hreflang tags to tell search engines which language or regional version of a page to show to users. Every page in a language group must link to every other version, including itself.

Last updated: 2026-05-25

limitations

  • Hreflang tags do not work on non-indexed pages. Each page in the group must be indexable by search engines.
  • Incorrect or mismatched language codes cause search engines to ignore the entire hreflang set.
  • Google uses hreflang as a hint. The wrong language version may still appear in search results for some queries.

Sources:MDN Web Docs · W3C Specifications · jquery.app on GitHub

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.

verification

  1. Verify hreflang tags across all language versions using Google Search Console International Targeting report.
  2. Check that every page in the language group links to every other version, including itself, using identical absolute 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.

What happens if a language code does not match the actual page content language?

Search engines may ignore the hreflang annotation entirely if they detect a mismatch between the declared language code and the actual page content. This can cause the wrong language version to appear in search results. Always verify that the language code matches the primary language of the page content, and that the page does not mix multiple languages in a way that confuses language detection.

Related tools

More seo tools

Seo

AI Crawler robots.txt Builder

Build a robots.txt policy for AI crawlers. Choose from open, selective, or strict presets and block specific AI training bots while allowing search engines.

Open tool

Seo

llms.txt Validator

Validate llms.txt files against the specification. Check H1 headings, blockquote summaries, section structure, and Markdown link formatting.

Open tool

Also try

Also try

Html

ARIA Live Region Generator

Generate accessible ARIA live region HTML snippets with role, aria-live, aria-atomic, and aria-relevant attributes. Includes optional JavaScript update function.

Open tool

Html

CSP Hash Generator

Generate CSP hash values for inline scripts and styles. Hash exact code content with SHA-256, SHA-384, or SHA-512 and get the matching CSP directive snippet.

Open tool