Hreflang Tag Generator

Make reciprocal hreflang tags or a sitemap from language codes and full page URLs.

Inputs stay on your device No sign-up Free to use
How this works

The tool runs in this browser. Your file or text is not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Privacy details

Build hreflang tags controls

Use language | full URL. Add x-default | URL for a fallback page.

Processed in your browser. Your inputs stay on this device.

Showing a generated example. Generate again for a new result.

How to use Hreflang Tag Generator

  1. Enter one language code and full page URL per line, separated by a vertical bar.
  2. Add an x-default row if you have a fallback page for visitors outside the listed languages.
  3. Choose HTML head tags or an XML sitemap and generate the code.
  4. For HTML, put the same complete tag set on every listed language page, including each page's own URL.

Example: Hreflang Tag Generator

Mark English and French versions of the same guide.

You add
en | https://example.com/en/guide and fr | https://example.com/fr/guide; Output format: HTML head tags.
You get
Two alternate link tags, one with hreflang="en" and one with hreflang="fr", ready to add to both pages.

Supported inputs and limits

Use 2 to 20 language variants in at most 12,000 characters. Each URL must be absolute http or https, without credentials or a fragment. The code check accepts common language, script and region shapes, but does not verify every locale supported by each search engine. Generated HTML must be copied to every variant for reciprocal links. The tool cannot fetch pages, confirm that translations match, or check a live sitemap.

Where your input is processed

This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Reciprocal entries matter

A search engine can ignore a language relationship when the two pages do not point back to each other. The HTML output is one complete set to place on each version. The XML output repeats that set for every listed URL. This local generator checks the lines you enter, not the live pages.

Google Search Central: Localized versions of your pages

Questions about Hreflang Tag Generator

Does every page need to link to itself?

Yes. Include the full alternate set on each localized page, including the page currently being viewed.

When should I add x-default?

Add it for a language selector or other fallback page intended for visitors whose language is not one of the listed variants.

Can the URLs be on different domains?

Yes. Use full URLs for each variant and make sure the pages refer back to each other after you publish them.

Should I use HTML and a sitemap together?

One correctly maintained method is enough. Choose the method your site can keep current as pages change.

Project manager: Tony Hines · Content updated 29 September 2026 · Report a problem