My Tool Studio
SEO

Hreflang Tags Generator

Serving the same pages in English, Spanish, and French means telling Google which URL belongs to which audience, and the markup for that is famously easy to get wrong. This hreflang generator keeps it mechanical. Each row pairs a language code with a URL, the defaults show en, es, fr, and x-default so the expected shape is obvious, and the output rebuilds as you type. Use it as an hreflang tag generator when you launch a translated section, or to produce hreflang tags for multilingual site templates your CMS can loop over. Because it's a plain hreflang code generator with no crawling involved, you decide exactly which URL fills each slot.

Always freeNo sign upRuns in your browser
<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

How to use

01

Fill in language and URL pairs

Each row takes a code on the left, like en, es-MX, or x-default, and the full page URL on the right. Edit the four sample rows to match your own site first.

02

Add or remove locales

Press + Add language for each extra market and fill in the new row. The trash icon deletes a row, and any row missing a code or a URL is left out of the output.

03

Copy the alternate link tags

The HTML pane shows one link rel=alternate line per row. Copy the block into the head of every language version, keeping the full set identical on each page.

Why Hreflang Tags Generator

Common questions

What format do hreflang language codes use?
A two-letter ISO 639-1 language code, optionally followed by a hyphen and an ISO 3166-1 region code. So es targets Spanish speakers everywhere, while es-MX targets Spanish speakers in Mexico. Region alone, like just MX, is invalid.
Why do I need an x-default row in the hreflang set?
The x-default entry names the page users get when none of your listed languages match theirs, typically your global or English homepage with a language picker. Google recommends it, and without one, users from unlisted regions get whatever Google guesses is closest.
Do hreflang tags have to appear on every language version?
Yes. Each page in the group must carry the complete set, including a reference to itself, and every pair must point back at each other. If the Spanish page lists the English one but not the reverse, that return link is missing and Google drops the annotation.
Can hreflang target the same language in two countries?
That's one of its main jobs. An en-GB row and an en-US row let you show pounds to London and dollars to Boston with otherwise similar content, and hreflang stops those two pages from being treated as competing duplicates.
Should the URLs in each hreflang row be absolute?
Yes, full URLs with protocol and domain, like the https://example.com/es/ default in the tool. Relative paths aren't reliable in alternate annotations, and each URL should be the canonical, indexable version of that language page.
How many rows can the hreflang generator handle?
As many as you add; the + Add language button has no cap. Sites with dozens of locale variants usually move the annotations into an XML sitemap eventually, but the generated head tags stay valid at any count.
Why is Google ignoring my hreflang annotations?
The usual suspects are missing return tags, URLs that redirect or aren't the canonical version, and malformed codes like en-UK instead of en-GB. Fix the pairing first: every listed page must list every other page, in both directions.

More SEO tools

View all