Hreflang Checker

Check hreflang in pasted HTML or an XML sitemap. Validate language codes, alternate URLs, self-references, and return links between supplied pages.

Source markup

Leave blank to use an absolute canonical URL from the HTML.

Annotation results

Paste or open the source, then check its annotations.

Check HTML or an XML sitemap

Paste the page’s HTML head or open a local HTML file to inspect its alternate links. Enter the published page URL when the HTML has no absolute canonical URL. Choose XML sitemap to check xhtml:link annotations in a sitemap. The checker uses the supplied source in your browser.

Read language codes and alternate URLs

Use a supported language such as en, with an optional script or region such as zh-Hans or en-GB. Use x-default for an optional fallback page. Every alternate link needs an absolute URL. Duplicate language codes on one page can make the intended alternate ambiguous.

A page with hreflang should include a link to itself. When the sitemap contains an alternate page, the checker can see whether that page links back to the source. Return link unchecked means there is insufficient page source to verify that link. Supply a sitemap containing both pages to compare them in one check.

Review the results before publishing

Start with pages that have issues. Fix the source HTML or sitemap, then check the updated markup again. Verify that each alternate points to the intended published language version. Google Search Central guidance on localized versions