Skip to content

Hreflang Generator

Text Tools•Client-Side & Private

Turn language/region + URL rows into the full reciprocal hreflang set in all 3 Google formats — HTML head, XML sitemap and HTTP header.

Tool workspace

Language versions — one row per page

Self-reference is built in: this set lists every page, including itself, for each page. That only works if every page actually carries this set when published — check each page's <head> (or sitemap/headers) after deploying.

Paste into the <head> of every page in the set

Google's rules, built into the checks: language codes are lowercase ISO 639-1 (en, not EN), region codes are uppercase ISO 3166-1 (GB, not gb), every page must list itself (self-reference) and every other version (reciprocal links), and each language/region appears once. Hreflang is a hint, not a redirect — it does not send visitors to the right version by itself.

Loading tool controls…

Files processed locally — never uploaded to our servers
Free Instant Private

Verify it yourself: press F12, open the Network tab, and use this tool — your files are never uploaded.

Hreflang Generator at a glance

Price
Free
Account
Not required
File uploads
None — your files are never uploaded
Category
Text Tools

Who uses Text Tools?

Writers, editors, students and anyone who works with words — from counting words in an essay to comparing two drafts.

How to Use Hreflang Generator

Follow these simple steps to get instant results in your browser.

1

Add One Row per Language Version

Enter the ISO language code, an optional region, and the page URL for each version — the sample shows English, English-GB, French and German.

2

Set x-default

Enter the language-selector or global homepage URL used when no version matches.

3

Copy the Format You Need

Switch between HTML head tags, XML sitemap and HTTP headers, fix any flagged errors, then copy or download.

💡

What is Hreflang Generator & How Does It Work?

Hreflang Generator turns rows of language/region plus URL into the complete reciprocal hreflang tag set in all three formats Google supports: HTML <link> tags for the <head> of every page, <xhtml:link> entries for an XML sitemap, and HTTP Link headers for non-HTML files such as PDFs. One set of rows, three outputs, ready to paste.

Hreflang tells Google which language and region each version of a page is for — hreflang="en-GB" for the British English page, hreflang="fr" for the French page — so searchers see the right version. It is a hint, not a redirect: it does not send visitors to the right version by itself. The tool validates ISO 639-1 language codes (lowercase, e.g. en) and ISO 3166-1 region codes (uppercase, e.g. GB), and flags the common mistakes: wrong case, duplicate languages or URLs, malformed URLs, and a missing x-default. Self-reference is built into every generated set, but each page must actually carry the set when published.

The most common hreflang mistake is missing reciprocal links: page A links to page B, but page B does not link back, and Google then ignores the hreflang. This generator outputs the same full set for every page, so reciprocity is built in — but each page must actually carry the set when published, which only you can verify on your site.

⚡

Key Features & Capabilities

✓

All Three Google Formats

HTML head tags, XML sitemap entries and HTTP Link headers from one set of rows.

✓

ISO Code Validation

ISO 639-1 languages and ISO 3166-1 regions checked, with case auto-normalised.

✓

Common-Mistake Checks

Duplicates, malformed URLs, missing x-default and self-reference all flagged.

✓

x-default Support

A dedicated x-default row for the language selector or global homepage.

✓

Copy or Download

Each format copies to the clipboard or downloads as a file.

Pro Tips

  • •Bookmark this tool for instant one-click access anytime.
  • •Drag and drop files directly onto the input surface for fastest handling.
  • •All processing happens in your browser session for maximum speed and data safety.

🎯 Common Use Cases

Launching Translated PagesGenerate the hreflang set for a new French and German version of a page.
Fixing Regional VersionsAdd en-GB vs en-US versions with correct region codes and x-default.
PDFs and Non-HTML FilesUse the HTTP header format for translated PDFs, which cannot carry <head> tags.
A Multilingual Product LaunchGenerate the set for a new product page in English, French and German, with x-default pointing at the language selector.
📚

Sources & Further Reading

Frequently Asked Questions about Hreflang Generator

Frequently asked questions

Hreflang tells Google which language and region each version of a page is for — e.g. hreflang="en-GB" for the British English page — so searchers see the right version. It is a hint, not a redirect.

All three Google supports: HTML <link> tags for the <head> of every page in the set, <xhtml:link> entries for an XML sitemap, and HTTP Link headers for non-HTML files like PDFs.

ISO 639-1 language codes (lowercase) and ISO 3166-1 region codes (uppercase), duplicate languages or URLs, malformed URLs, a missing x-default, and self-reference — every page must list itself and every other version.

Add one if you have a language-selector page or a global homepage for visitors whose language matches none of your versions. Google recommends it, and the tool warns if it is missing.

Missing reciprocal links: page A links to page B, but page B does not link back. Google ignores hreflang that is not reciprocal — so paste the same full tag set on every page in the set.

A well-formed 2–3 letter code that is not in the built-in ISO 639-1 list gets a warning, not an error — it is kept in the output, so double-check it before publishing.

Yes — each format has a Download button: HTML saves as hreflang.html, the sitemap as sitemap.xml, and the headers as hreflang-headers.txt.

Complementary utilities for your workflow

View all →
You are here

Hreflang Generator

Hreflang tags in HTML, sitemap and header formats.

Current tool

Text Compare

Diff two texts and highlight changes line-by-line.

Try tool

Split CSV

Split a CSV into N files, by row count, or by a column value — ZIP download.

Try tool
New

Hashtag Generator

Generate platform-ready hashtags for Instagram, TikTok, YouTube and X.

Try tool
New

AI Text Humanizer

Rewrite AI drafts to sound natural with word and sentence rules — rule-based, not an AI model.

Try tool