--- title: "Document and parts language" category: accessibility status: required url: https://webspecification.com/spec/accessibility/document-language/ updated: "2026-05-29T09:13:20.000Z" sources: - title: "WCAG 3.1.1 — Language of Page (Level A)" url: "https://www.w3.org/WAI/WCAG22/Understanding/language-of-page.html" publisher: "W3C" - title: "WCAG 3.1.2 — Language of Parts (Level AA)" url: "https://www.w3.org/WAI/WCAG22/Understanding/language-of-parts.html" publisher: "W3C" - title: "Accessibility Checker — Missing Language Declaration" url: "https://equalizedigital.com/accessibility-checker/documentation/missing-language-declaration/" publisher: "Equalize Digital" - title: "MDN — The lang global attribute" url: "https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/lang" publisher: "MDN" source_repo: undefined licence: CC-BY-4.0 --- # Document and parts language > Set the page's primary language on and mark any inline content in a different language with its own lang attribute, so screen readers pronounce it correctly. ## What it is The `lang` attribute tells browsers, screen readers, search engines, translation tools, and AI agents what language a piece of content is written in. WCAG 3.1.1 (Level A) requires the page's primary language to be set on the root `` element. WCAG 3.1.2 (Level AA) requires any inline passage in a different language to be marked too. The value is a BCP 47 language tag — `en`, `nl`, `de`, `pt-BR`, `zh-Hant` — not a free-text string. ## Why it matters Screen readers switch their pronunciation and accent based on `lang`. Without it, a Dutch screen reader will sing English words like Dutch, and an English one will mangle French. Translation tools and AI agents use it to decide whether to translate the text. Spell-checkers, hyphenation, and quotation marks all depend on it. A missing `lang` is a Level A failure — the lowest possible bar — and one of the easiest accessibility findings for an automated scanner to catch. ## How to implement Set the page language on ``: ```html
… … ``` For a French quotation inside an English page, wrap it and mark the language: ```html
As Antoine de Saint-Exupéry wrote,
on ne voit bien qu'avec le cœur
—
one sees clearly only with the heart.