</>
ValidateHTML

Missing Language Attribute

The lang attribute on the <html> element declares the primary language of the page content. Screen readers use this to switch to the correct pronunciation engine. Without it, a screen reader might try to read French content with English pronunciation rules, making it incomprehensible.

Why It Matters

Missing lang is a WCAG 2.1 Level A violation. Screen readers default to the user's system language, which may not match the page content. Search engines use the lang attribute to serve the correct language version in search results. It's one of the easiest accessibility fixes and has direct SEO benefits.

Code Examples

Inaccessible
<!-- No lang attribute -->
<html>
<head>...</head>

<!-- Wrong: lang on body instead of html -->
<html>
<body lang="en">
Accessible
<!-- Correct: lang on html element -->
<html lang="en">

<!-- For French content -->
<html lang="fr">

<!-- For specific regional variant -->
<html lang="en-US">

How to Fix

  • 1Add lang="en" (or your language code) to the opening <html> tag.
  • 2Use the correct ISO 639-1 language code: en, fr, de, es, ja, zh, etc.
  • 3For mixed-language content, set the main language on <html> and use lang attributes on specific elements for other languages.
  • 4If your site serves multiple languages, use different lang values on each language version.

Check Your Accessibility Now

Our accessibility checker detects this issue automatically.

Open Accessibility Checker
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy accessible, validated code on reliable hosting.

Get 80% Off Hosting →

Related Accessibility Errors

View all accessibility errors