Marketing tool

Hreflang tag generator

Generate reciprocal alternate-language markup from a URL-language table.

Your inputs

Headers url,language. One equivalent page cluster, 2–100 mappings. Supported scripts: Hans and Hant.

Your results

Ready when you are
Add your inputs or try an example.
Your results will appear here.

How it works

Create a complete set of alternate-language HTML links from equivalent page variants. Every generated block includes all mappings so each page can reference itself and its counterparts. Copy the relevant block into the HTML head of every listed page.

Read the source reference ↗

A few things to know

No live crawl, translation detection, canonical check or indexing guarantee. Supports ISO 639-1 two-letter languages, assigned two-letter regions, x-default and Hans/Hant script subtags only. Other valid scripts require manual markup. URLs must be absolute, without credentials or fragments. Enter one cluster of equivalent content, not unrelated site pages.

A little context

When to use this tool

A multilingual page needs a clear relationship with its equivalent versions. This hreflang tag generator takes a small URL-and-language table and builds an identical HTML annotation block for every page in that cluster. Use it when the content is equivalent across markets, such as one product described in English and German. It saves repetitive typing while leaving translation quality, deployment and page selection in your hands.

  • Prepare alternate tags for a product page translated into two or more languages.
  • Connect regional English pages with a generic English version and an optional fallback.
  • Rebuild a complete annotation block after adding a localized version or changing its URL.

How to use hreflang tag generator

  1. List one equivalent page cluster

    Paste a CSV with url and language headers. Each row needs an absolute HTTP or HTTPS URL and one language value. Supply 2–100 mappings. Use separate runs for different products, articles or other unrelated content.

  2. Check language and destination choices

    Choose codes such as en, en-GB or de. The generator accepts assigned two-letter regions, x-default and Hans/Hant scripts. Remove fragments, credentials and duplicate language values. One destination may serve both a language and x-default.

  3. Install and verify the block

    Generate the result and copy the complete block into the head of every unique page shown. The text download identifies each destination. After deployment, export the actual annotations and run the consistency checker to compare them.

Try the numbers

English, German and a fallback

Inputs

The example provides https://example.com/en/product for en, https://example.com/de/product for de, and https://example.com/product for x-default.

Result

The tool reports 3 language mappings, 3 pages requiring the block and 3 tags per page. Each page gets the same three alternate links.

What it means

The output covers the supplied cluster completely. The fallback is a separate mapping; it is not a fourth page invented by the generator. You still need to publish the block on all three destinations.

Common mistakes to avoid

Grouping unrelated pages

A category page and an individual product are different jobs even if their language codes differ. Build clusters around equivalent content rather than every URL in a country folder.

Using a country as a language

A region does not replace the leading language value. This generator requires a supported language first, and rejects region combinations such as en-UK. Use en-GB when that is the intended audience.

Copying only selected tags

The output is a complete block. Removing its self entry or publishing different partial blocks creates relationships the generated file no longer represents.

Useful answers

Frequently asked questions

Definitions, edge cases, and practical next steps for this tool. Search all tool FAQs ↗

What does the generator produce?

It produces HTML link elements for the alternate versions you supply, grouped under each unique destination URL. The markup is plain copyable text. It does not edit a website, create translated pages or change your CMS configuration.

Can I put several products in one CSV?

Use a separate run for each equivalent-content cluster. This tool treats every row as a version of the same page. Mixing products would therefore create alternate relationships between different products, even though the CSV is structurally valid.

What is x-default for?

Use it for a fallback destination for audiences without a matching language or region mapping. A selector page is one possible choice. The field is optional; including it should reflect a deliberate destination choice rather than an automatic SEO checkbox.

Why is the same URL allowed more than once?

One page can intentionally serve multiple audiences, including a language and the fallback. Language values must still be unique. The tool counts mappings separately from unique destinations, so repeated URLs can mean fewer installation locations than tags.

Where do I paste the generated HTML?

Put the complete block in each listed page’s HTML head using the appropriate template or CMS setting. The page itself must be available. Copying the code into a visible paragraph or leaving it only in a downloaded file does not deploy it.

Does this support every valid script subtag?

No. It supports two-letter languages, assigned two-letter regions and Hans/Hant script combinations. Other script variations need manual markup and verification. An unsupported input here does not prove that every possible annotation using that script is invalid.

Why does the output contain ampersand entities?

The generator escapes characters needed inside HTML attributes. A query separator becomes & in the source markup. That protects the attribute syntax; it does not mean you should replace the actual destination URL with a different campaign or page.

What should I check after publishing?

Compare the rendered annotations with your source table, then review page availability, canonical destinations and content equivalence. Use the offline consistency checker on exported mappings. A clean generated block cannot establish what a crawler receives on the live website.

Explore the topic in the blog

Sources and method

Use the references below to check definitions and platform guidance. The model’s scope and limits are explained above. Read our editorial standards.

Help

How can we help?

Find instructions, report a problem, or leave a message.

Read this tool’s FAQs ↗

Guides for this tool

Check that every language version points back to its equivalents.
Common questions

Where do I start? Try an example, then replace its values with yours.

Why did my upload fail? Check the field error, accepted format and file-size limit. Start with a small sanitized sample.

Where are my results? Review the result panel, then use its copy or download controls. If a calculation fails, check the error beside the input.

Message us

Chat opens Tawk.to. It processes your messages and connection data. Do not paste private inputs or file contents. Availability and response times vary.