Zero Signup ToolsFree browser tools

SEO Tools

Hreflang Tag Generator

Generate reciprocal hreflang link tags, HTTP Link headers, and XML sitemap entries for international SEO. Validates ISO 639-1 and ISO 3166-1 codes.

Quick presets

Page alternates

Add a row for each translated or regional URL

hreflang="en"English
hreflang="es"Spanish
hreflang="fr"French
hreflang="de"German
hreflang="x-default"x-default
Looks good. Every row passes the language, region, and uniqueness checks.

Output format

Drop these <link rel="alternate"> tags into the <head> of every alternate page.

Privacy

URLs and codes never leave your browser. The generator runs on your device and emits the markup locally.

How to use

  1. Pick a quick preset (EN/ES/FR/DE, EN-US and EN-GB, ES-MX/AR/CO with PT-BR, or ZH Hans/Hant with EN and JA) to start from a known-good shape, or click Clear and add rows from scratch.
  2. For each translated or regional version of the page, paste its absolute URL (https://...), enter a two letter ISO 639-1 language code (en, es, zh, ja), and optionally an uppercase ISO 3166-1 region code (US, GB, BR) or a script subtag (Hans, Hant).
  3. Use Add x-default to add the fallback row that points at the page search engines should serve when no language or region matches. Only one x-default row is allowed.
  4. Read the validation panel as you type. Errors block publishing; warnings are recommendations; notes flag uncommon but valid codes.
  5. Pick the output format that fits your stack: HTML link tags for static pages and templates, HTTP Link headers for non-HTML files like PDFs, or the XML sitemap snippet (with reciprocal links already included) for sitemap-driven setups.
  6. Click Copy or Download to grab the generated markup, then paste the HTML tags into the <head> of every alternate page (or set the Link header on every alternate response, or upload the sitemap to your domain).

About this tool

Hreflang Tag Generator builds the cross-referenced markup search engines use to serve the right language and region version of a page. Add a row for every translated or regional URL, pick a language code (ISO 639-1, like en, es, zh), an optional region code (ISO 3166-1 alpha-2, like US, GB, BR), and an optional script subtag for cases like zh-Hans (Simplified Chinese) and zh-Hant (Traditional Chinese), and the tool emits the markup live as you type. Three output formats are supported per Google's spec: HTML <link rel="alternate" hreflang="..." href="..." /> tags ready to paste into the <head> of every alternate page, an HTTP Link: response header that works for non-HTML files like PDFs and is set by the server, and a full XML sitemap snippet using the xhtml namespace where each <url> entry already includes every alternate (including itself, as Google requires) so you do not have to repeat the cross references by hand. Validation runs as you type. Language codes are checked against a curated ISO 639-1 list and the lowercase two or three letter format Google requires, region codes are checked against a full ISO 3166-1 alpha-2 list in uppercase, script subtags are checked for the title-case ISO 15924 format with notes when the tag is unusual outside Hans and Hant, the same hreflang value cannot appear twice (a hard error), only one row can be marked x-default (a hard error if more), and a missing x-default fallback triggers a warning. Quick presets seed common configurations: four European languages with x-default English, the classic en-US and en-GB split, Latin American Spanish variants with Brazilian Portuguese, and Simplified plus Traditional Chinese alongside English and Japanese. Each row shows the resolved hreflang value as you type so you can see at a glance what zh-Hant or pt-BR will look like in the final markup. The Download button writes the generated output to a local file (sitemap.xml, link-headers.txt, or hreflang-tags.html) ready to upload to your CMS, server config, or static site bundle. Useful for SEO teams launching a localized site for the first time, ecommerce stores expanding into a new country and needing reciprocal annotations on every product page, agencies auditing a client's international setup and rewriting it from scratch, marketers spinning up a Latin American Spanish variant of a campaign landing page, and developers wiring xhtml:link entries into a sitemap pipeline. Hreflang annotations must be reciprocal: every page in the alternate set has to list every other page (and itself), or search engines ignore the whole set. The XML sitemap output handles that automatically; the HTML and HTTP outputs must be applied to every alternate page in the set, not just one. Everything runs locally in your browser, so the URLs and codes you enter never leave your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsSEO Tools