hreflang Generator
Generate hreflang link tags.
About this tool
Type each language version as code|url, one per line, and press Generate. You get a link rel=alternate tag with hreflang for each version.
How to use
How it works
Each line is split at the first |. The part before it becomes the hreflang value and the part after becomes the href. Values are HTML-escaped. Codes such as en, fr or en-GB, and x-default, are written exactly as typed. The tool does not validate them, blank lines are skipped, and a line with no URL after the | gives an error. Every version must list all versions including itself.
Worked example
English and French
- Input
- en|https://example.com/ fr|https://example.com/fr/
- Output
- <link rel="alternate" hreflang="en" href="https://example.com/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
- Walkthrough
- One tag per line, using the code and URL you typed.
Limitations
- Language and region codes are not validated.
- Does not check that return links exist on the other pages.
- Generates head link tags only, not sitemap hreflang entries.
Questions
How do I add hreflang tags?
Do I need an x-default?
Does each page need all the tags?
Features
- One tag per line
- HTML-escaped output
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Google Search Console Training trailer
Google Search Central
Series overview for Search Console workflows.
Watch on YouTubeHTML Crash Course For Absolute Beginners
Traversy Media
Title/meta tags live in HTML these SEO tools preview.
Watch on YouTube
- Schema.org
Schema.org
Vocabulary for JSON-LD generators on SEO pages.
- Sitemaps overview
Google Search Central
When sitemap and URL tools matter for discovery.