---
title: "HTML Lang Attribute Checker & BCP 47 Syntax Test"
description: "Check a page's html lang, xml:lang, and dir values, validate basic BCP 47 syntax, and find missing or mismatched language attributes."
canonical_url: "https://webaloha.co/tools/html-lang-attribute-checker/"
markdown_url: "https://webaloha.co/tools/html-lang-attribute-checker.md"
date_modified: "2026-07-12T00:00:00.000Z"
---
# HTML Lang Attribute Checker

Last updated: Jul 12, 2026

Check the lang attribute on any page in seconds. We read the html element, validate the language tag against BCP 47, report text direction, and flag missing or mismatched values that hurt accessibility and SEO.

## How the Checker Works

1.  **Safe fetch**, the host is validated before our server requests the page.
2.  **Read the html tag**, the lang, xml:lang, and dir attributes are extracted.
3.  **Validate**, the language tag is checked against BCP 47 syntax.
4.  **Report**, you get the values, the primary language, and any issues.

## Why It Matters

-   **Accessibility**, screen readers pick the right voice and pronunciation.
-   **Correct rendering**, browsers apply language-specific typography and hyphenation.
-   **Translation**, tools detect the source language accurately.
-   **SEO support**, it reinforces page language alongside hreflang.

Language signals are one small piece of technical and international SEO, and getting the whole stack right is the kind of work our [SEO services](https://webaloha.co/seo-services/) handle end to end.

## Common lang Attribute Values Reference

The lang value follows BCP 47: a primary language subtag on its own, or a language-REGION pair when you need to specify a regional variant. The table below lists values you will see most often, including a right-to-left example.

| Value | Language / region | Note |
| --- | --- | --- |
| **en** | English (no region) | Generic English; fine when no regional variant is needed. |
| **en-US** | English, United States | US spelling, date, and number conventions. |
| **en-GB** | English, United Kingdom | UK spelling and conventions. |
| **es** | Spanish (no region) | Generic Spanish. |
| **es-ES** | Spanish, Spain | European (Castilian) Spanish. |
| **fr** | French (no region) | Generic French. |
| **fr-CA** | French, Canada | Canadian French. |
| **de** | German | Generic German. |
| **pt-BR** | Portuguese, Brazil | Brazilian Portuguese (pt-PT for Portugal). |
| **zh-Hans** | Chinese, Simplified script | Script subtag; zh-Hant for Traditional. |
| **ar** | Arabic (RTL) | Right-to-left; also set dir="rtl" on the html element. |

Format reminder: use the language subtag alone (en) or language-REGION (en-US), following BCP 47. Lowercase the language, title-case any script (Hans), and uppercase the region (US).

Next steps

## HTML Lang Attribute Checker related tools and articles

Continue with the closest follow-up checks and guides based on this tool's topic, crawl intent, and optimization workflow.

[![Hreflang Tags Checker Tool Online](https://webaloha.co/_astro/tool-hreflang-checker.wnF1n3Tb_Z220gEc.webp?dpl=dpl_H1MtSCmk524EGpEs7Etp4HWKr3Ti)

Hreflang Checker

](https://webaloha.co/tools/hreflang-checker/)[![Technical SEO Audit: What to Check and How to Fix It](https://webaloha.co/_astro/blog-technical-seo-audit.DBRDzgnk_KFMKo.webp?dpl=dpl_H1MtSCmk524EGpEs7Etp4HWKr3Ti)

Technical SEO Audit Guide

](https://webaloha.co/technical-seo-audit-guide/)[![Meta Tags That Actually Matter for SEO in 2026](https://webaloha.co/_astro/blog-meta-tags-seo.DHtj3g8-_Z867DG.webp?dpl=dpl_H1MtSCmk524EGpEs7Etp4HWKr3Ti)

Meta Tags SEO Guide

](https://webaloha.co/meta-tags-seo-guide/)[![Meta Tag Checker Tool Online](https://webaloha.co/_astro/tool-meta-checker.DJR8z9Ql_Z11a27K.webp?dpl=dpl_H1MtSCmk524EGpEs7Etp4HWKr3Ti)

Meta Tag Checker

](https://webaloha.co/tools/meta-tag-checker/)[![Website Accessibility Checker Tool Online](https://webaloha.co/_astro/tool-accessibility.BbxoQaXU_qspnK.webp?dpl=dpl_H1MtSCmk524EGpEs7Etp4HWKr3Ti)

Accessibility Checker

](https://webaloha.co/tools/accessibility-checker/)[![X-Robots-Tag & Noindex Checker Tool Online](https://webaloha.co/_astro/tool-x-robots.DSxq3GKh_1i4Bnc.webp?dpl=dpl_H1MtSCmk524EGpEs7Etp4HWKr3Ti)

X-Robots-Tag Checker

](https://webaloha.co/tools/x-robots-tag-checker/)

## HTML Lang Attribute Checker: FAQ

What exactly does the checker inspect?

It fetches the submitted public page and reads the opening html element from the returned HTML. It reports lang, xml:lang, dir, the primary language subtag, the final URL after redirects, and the HTTP status.

What does a valid result mean?

Valid means a lang value was present and matched this checker's language-tag pattern: a two- or three-letter primary subtag followed by optional 2-to-8-character subtags. It is a useful syntax check, not a complete registry lookup for every BCP 47 rule.

Why can a syntactically valid lang value still be wrong?

The checker cannot determine whether the declared language matches the page's actual writing. Review the result against the main content language, and use region or script subtags only when they are genuinely needed.

How are lang and xml:lang handled?

The HTML lang attribute is the main value. If xml:lang is also present, the tool reports it and flags a case-insensitive mismatch. A missing xml:lang is not treated as an issue for ordinary HTML pages.

Does the checker validate right-to-left direction?

It reports the dir attribute when present, but it does not decide whether ltr, rtl, or auto is correct for the content. For languages such as Arabic or Hebrew, verify direction and mixed-direction components in the rendered page.

Why might the checker miss a lang attribute I can see in the browser?

It analyzes the server-returned HTML, up to 512 KB, rather than executing page JavaScript. A client-side framework that adds or changes lang after load will not be reflected. Timeouts, bot protection, or a non-public host can also prevent the fetch.

What should I change when lang is missing?

Set a language tag on the root html element in the server-rendered document, for example lang="en". On multilingual sites, make sure each localized page emits its own correct value rather than inheriting one site-wide default.

What data leaves my browser during a check?

The URL is sent to Web Aloha's server so it can fetch the public page. The endpoint returns the parsed html-tag details and does not include application logic that persists the fetched page or result, but normal infrastructure logs may still record requests.

Free 48-Hour Website Audit

Not sure what to fix first on your own website? We'll review it and tell you, in plain English. Free & non-obligatory.

[Get My Free Audit 💪](https://webaloha.co/free-website-audit/)

## Want an Accessible, Search-Ready Site?

We build websites that meet accessibility standards and rank well, with correct language signals baked in.

[Explore Web Services](https://webaloha.co/services/)
