The lang attribute on
type: TechArticle
description: Set a valid BCP 47 language tag on the element so screen readers, translators, search engines, and browsers know what language the page is in.
language: en
is part of: Web Specification Studio
author: Web Specification Studio
publisher: Web Specification Studio
license: https://creativecommons.org/licenses/by/4.0/
date modified: 2026-05-29T09:13:20.000Z
citation: HTML Living Standard — The lang and xml:lang attributes
  type: CreativeWork
  publisher: WHATWG
citation: MDN — HTML lang global attribute
  type: CreativeWork
  publisher: MDN
citation: BCP 47 — Tags for Identifying Languages
  type: CreativeWork
  publisher: IETF
citation: WCAG 3.1.1 — Language of Page (Level A)
  type: CreativeWork
  publisher: W3C

Web Specification Studio
type: WebSite

Web Specification Studio
type: Organization

breadcrumb
type: BreadcrumbList
item list element: Home
  type: ListItem
  position: 1
  item: https://webspecification.com/
item list element: Spec
  type: ListItem
  position: 2
  item: https://webspecification.com/spec/
item list element: Foundations
  type: ListItem
  position: 3
  item: https://webspecification.com/spec/foundations/
item list element: The lang attribute on
  type: ListItem
  position: 4
  item: https://webspecification.com/spec/foundations/html-lang/