SiteTidy
Home /Tools /HTML Lang Checker

HTML Lang Checker

Ensure your document's root <html> tag has a valid language attribute for accessibility and international SEO.

HTML Source

HTML Lang Checker

Instantly check the language declaration of your document.

Awaiting Code

Paste your HTML document here to analyze the language declaration.

Why the `lang` Attribute is Crucial

The lang attribute in the <html> tag tells browsers and assistive technologies what the primary language of the page is.

Accessibility (Screen Readers)

Screen readers use the lang attribute to determine which pronunciation rules and voice profiles to use. If a Spanish user visits an English site without a lang="en" attribute, their screen reader will try to read the English text using Spanish pronunciation rules, resulting in unintelligible gibberish.

Search Engine Optimization (SEO)

Search engines like Bing and Google use the lang attribute (alongside hreflang tags) to understand the language of your content and serve it to the right users in the right regions.

Formatting (BCP 47)

The attribute must follow the BCP 47 standard. It usually consists of a 2-3 letter language code, optionally followed by a region code.

  • en (English)
  • en-US (English, United States)
  • en-GB (English, Great Britain)
  • fr-CA (French, Canada)
  • zh-Hans (Chinese, Simplified script)

Related Guides

Deepen your understanding with our expert articles.