Hreflang Tag Generator
Build reciprocal hreflang tags for every language version of a page as HTML link tags, an HTTP Link header or an XML sitemap.
Language versions
| Language / locale | Page URL | Remove |
|---|
Add at least two language versions to generate hreflang tags.
How it works
Hreflang tags tell Google and Bing which language or country version of a page to show
to which visitor. Type your default page URL, pick a URL style and press
Auto-fill URLs to build the address for every locale, or paste each URL
by hand. The generator validates every language code against the ISO 639-1 language,
ISO 15924 script and ISO 3166-1 Alpha-2 country pattern that search engines accept, warns
you about duplicates and normalises casing (en-gb becomes en-GB).
Every generated set is fully reciprocal and self-referencing — each page lists all the
alternates including itself, which is exactly what search engines require. Switch the
output format to get HTML <link> tags for your <head>,
an HTTP Link: header for PDFs and other non-HTML files, or an XML sitemap
with xhtml:link annotations. Add an x-default entry to point
visitors whose language you do not cover at a global or language-selector page. Everything
is generated by plain JavaScript in your browser — no upload, no sign-up and no ads.
Frequently asked questions
How do I add hreflang tags to my website?
List every language version of the page, each with its locale code (like en, en-GB or zh-Hans) and its full URL, then copy the generated block. Paste the HTML <link rel="alternate" hreflang="…"> tags into the <head> of every one of those pages — the set must be identical and self-referencing on each page, which this generator does for you automatically. If you cannot edit the head (PDFs, for example) use the HTTP Link header output instead, or add the XML sitemap output with its xhtml:link annotations.
What is the x-default hreflang tag and do I need one?
x-default tells search engines which page to show visitors whose language or country you do not explicitly target — typically a global homepage or a language-selector page. It is optional but strongly recommended: without it, users outside your listed locales get whichever version the search engine guesses. Pick any of your URLs in the "x-default points to" dropdown and the extra tag is added to every output format.
Is this hreflang generator free and does it upload my URLs?
It is completely free with no account, no API key and no ads, and nothing leaves your device. The tags are built by plain JavaScript running in your browser, so your URLs and locale codes are never sent to a server — unlike most hreflang tools, which post your list to their backend. It also validates each code against the ISO 639-1 / ISO 15924 / ISO 3166-1 pattern, fixes casing such as en-gb to en-GB, and flags duplicates before you ship the tags.