The lang attribute

lang declares an element's content language using a BCP 47 code (e.g. uk, en, ru) — it affects screen reader pronunciation and auto-translation.

Applies to

global

Values

A BCP 47 language code: "uk", "en", "ru", "en-US", etc.

Example

<html lang="en">
<p lang="uk">Цей абзац українською.</p>

Edge cases

  • lang on <html> is required for correct screen reader behavior across the whole page, even if other elements don't set lang.
  • An incorrect lang causes screen readers to pronounce text with the wrong accent.

Accessibility

  • Without a correct lang, screen readers may pronounce text with the wrong engine accent.