Skip to content
cosmodev ~/tools/hreflang-tag-generator

Γεννήτρια ετικέτων hreflang

Generators

Μετατρέψτε μια λίστα γλωσσικών εκδόσεων σε έγκυρο σύνολο hreflang — κανονικοποίηση locale, εντοπισμός διπλότυπων και διαχείριση x-default — ως HTML link tags ή μπλοκ XML sitemap.

Language versions

One row per language version: a locale like en or de-AT and its absolute URL.

The page for users whose language does not match any row — usually the default version.

(Τεκμηρίωση στα αγγλικά)

What it does

The Hreflang Tag Generator turns a table of language versions into a correct hreflang set. Type locales loosely — en-us normalizes to en-US, PT-br to pt-BR — and the tool validates the rest: each locale must be ll or ll-CC, every URL must be absolute http(s), and no locale may appear twice. Add an x-default URL for visitors whose language matches none of the rows. The output comes in two shapes: HTML <link rel="alternate"> tags for your <head>, or xhtml:link lines for an XML sitemap entry.

Everything runs 100% client-side.

How to use it

  1. Add one row per language version: locale on the left, absolute URL on the right.
  2. Optionally set the x-default URL — it is emitted last.
  3. Switch the output between HTML and Sitemap and copy the block.

Examples

  • en → https://example.com/, de-de → https://example.com/de/, x-default https://example.com/ → three link tags, with de-DE normalized and x-default last.
  • Rows en and EN → the output lists Row 2: locale "en" is already used. and emits nothing until the duplicate is gone.

Good to know

  • Google’s hreflang grammar accepts two-letter language codes, optionally with a two-letter region — script subtags and three-letter codes are rejected rather than guessed at.
  • The sitemap block belongs inside a <url> entry, next to the <loc> tag — the tool indents it accordingly.
  • Every error names its row number, so long tables stay fixable.
Πηγαίος κώδικας14 γλώσσες

100% client-side · τα δεδομένα σου δεν φεύγουν ποτέ από τον browser. Σου φάνηκε χρήσιμο; Μοιράσου το με έναν συναδέλφο.