Skip to content

Language & reading

A Lang Attribute on Part of the Page Has an Invalid Value

When a passage is marked with a language code that doesn't exist, screen readers can't switch voice, so foreign words come out garbled or mispronounced.

valid-langWCAG 2.0Introduced in WCAG 2.0.Level AAAA — the Australian baseline (WCAG 2.2 AA) most laws and policies ask for.

Status
SeriousSerious — Significant friction, or information that is lost.CurrentScanners run this rule today.
Owner
DevContentTest
Audit
Automated+ManualA scanner finds it; a person confirms the fix.
Save as PDF (opens in a new tab)

Why it matters

The lang attribute tells a screen reader which language a passage is in. The reader then switches to the right voice and pronunciation.

If the code is misspelled or made up, like lang="english" or lang="fr_FR", the reader ignores it. A French quote gets read with English sounds, and listeners can't follow it.

Who it affects

Who it affects, and how much
WhoWhat they experienceImpact
Screen reader usersThey hear foreign words read with the wrong accent, which can be hard or impossible to understand.High impact
Low-vision users (magnification)Affected if they use a screen reader or text-to-speech, as many do.Partial impact
Cognitive and neurodivergent usersPeople who use read-aloud tools hear jumbled speech that is harder to follow.Partial impact

Business & product impact

Business & product impact, with how much each claim weighs
AreaWhyImpact
LegalIt relates to WCAG 3.1.2 Language of Parts at Level AA, the level most Australian policies and EN 301 549 require.Moderate impact
ConversionGarbled product names or translated content can stop people finishing a task.Low impact
SEOSearch engines rely on other signals for language, so expect little search benefit.Low impact
Brand trustMultilingual sites that read badly aloud look careless to the communities they want to reach.Moderate impact
Cost to fixUsually a quick fix to a code or a CMS setting.High impact

Fixing it in code

A quote in French

Don't

<blockquote lang="french">Je pense, donc je suis.</blockquote>

A screen reader says: “Read in an English voice: "Jee pence, donk jee sweez"”

Do

<blockquote lang="fr">Je pense, donc je suis.</blockquote>

A screen reader says: “Read in a French voice, pronounced correctly”

fr is a real language code; "french" is not.

A region variant

Don't

<p lang="pt_BR">Obrigado!</p>

A screen reader says: “Read in the page's default voice”

Do

<p lang="pt-BR">Obrigado!</p>

A screen reader says: “Read in a Brazilian Portuguese voice”

Language codes use a hyphen, not an underscore.

Designer's handoff note

When content mixes languages, mark which passages are in which language in your handover notes.

Content authors need a way in the CMS to pick a language for a passage from a fixed list, not type it freely.

Quick test

Checklist

Pass
The code is valid and the passage is read in the right accent.
Fail
The code is misspelled or made up, and the passage is read with the wrong accent.

Check these at the same time

What a green scan still misses

A scanner checks the code is real. It can't tell if it's the right language for the text, or if a foreign passage has no lang at all.

Reference

Rule ID
valid-lang
Raised by
  • axe-core: “lang attribute must have a valid value”
WCAG
Other standards
EN 301 549 9.3.1.2 · RGAA 8.8.1
Last reviewed
14 October 2026