Developer tools

Hreflang Tag Generator

Add a language code and URL for every localized version of your page, set an optional fallback, and copy the finished hreflang link tags.

x-default

How to use the hreflang tag generator

  1. Add each language versionEnter a language code and its matching URL for every localized page.
  2. Set an optional fallbackProvide an x-default URL for visitors who don't match any listed language.
  3. Copy the tagsPaste the generated hreflang link tags into every localized page's head.

Getting international targeting right

Hreflang tags tell search engines which URL to serve for each language or region, preventing the wrong localized version from showing up for a given searcher.

Language codes

Use simple codes like en or fr, or language-region pairs like en-US and pt-BR for more precise targeting.

x-default

A fallback URL shown to visitors whose language doesn't match any of your specific hreflang entries.

Reciprocal links

Every localized page should include the same full set of hreflang tags, including one pointing to itself.

Placement

Add these link tags to each page's head, or list them in your XML sitemap for larger sites.

Hreflang Tag Generator FAQ

What does hreflang do?

It tells search engines which URL to show for a given language or region, so users see the correct localized version of your page in search results.

What format should the language code use?

Use an ISO language code like en, or a language-region pair like en-GB or pt-BR, following the standard hreflang code format.

What is x-default for?

It specifies a fallback page to show visitors whose language or region doesn't match any of your other listed hreflang entries.

Do pages need to link back to each other?

Yes, every localized version of a page should include the same full set of hreflang tags, including a self-referencing entry for its own language.

Where do hreflang tags go?

Inside the head section of each localized page, or alternatively inside an XML sitemap for large sites.

Try other free tools

More handy tools from My Panda Toolbox.