About document language

Document language is simple code that identifies the language of the web page.

This is used by:

  • Browsers
  • Assistive technology
  • Third-party APIs like media players with captions or grammar checkers
Document with its language set to US English

When the document language is available, it allows the code to present the information correctly.

For example, a website set to “US English” will be correctly interpreted by grammar checkers and assistive technology.

How to tell if a document language is missing

Automated accessibility testing tools can detect if a document’s language is missing or incorrect. This may happen because of a coding error or because the document language was never set.

While these tools can catch the issue, a person may be needed to determine the correct language for the page.

Document with no language that’s available.

When the attribute is invalid or missing, it will default to the user’s system language. This may make the language appear incorrectly. For example, English text could appear as Spanish text.

Missing document language is like information getting lost in translation

Imagine shopping at a grocery store, and you come across an international snack that’s in a different language.

The photos on the package may give you a clue. But if you have health concerns, this isn’t enough. You try to read the ingredient list on the bag, but it’s not in your language. So, you can’t be sure it’s safe to eat.

Even if you have a translation app, there’s no guarantee it will work or be accurate. You may have poor signal or the app struggles with certain characters. If it’s been poorly translated, it may be difficult for those with dyslexia to understand.

How missing document language can impact assistive technology users

If language is not set, a device will read content based on its default settings. For example, if your computer is set to United States English, screen readers, voice assistants, and other assistive technologies will default to speaking with U.S. English pronunciation.

Person confused at monitor’s announcement

Play the audio below for an example. In this scenario, a screen reader announces Spanish in an U.S. English accent that’s hard to understand.

[Screen reader pronunciation of Spanish in the intended Spanish accent] “La selección masculina de fútbol de México es el equipo formado por jugadores de nacionalidad mexicana que representa a la Federación Mexicana de Fútbol (FMF).”

[Screen reader pronunciation of Spanish in an English accent]
”La seleck-eon masculine-a de foot-bowl de Mexico es el equip-o for-mad-o por juga-dores de national-y-dad mexican-a que represent-a a la Federation Mexican-a de foot-bowl (FMF).”

How does document language impact people without disabilities?

A online form with location set to ‘Paris, France” with the date not set yet

Document language can affect location-specific items like a date picker.

Let’s review a common scenario of booking a hotel for an international trip.

Imagine you are entering a date for your hotel booking. The form has the familiar format of ##/##/####. You enter the date you want to check in, but the search results have the wrong date. What’s going on?

The document language changes how dates are displayed

Different countries use different formats. If the wrong document language is set, people may view and interpret a date incorrectly.

In the U.S.

MM/DD/YYYY

Month, day, and year are commonly used in the U.S.

05/04/2030

In the U.S., we would read this date as May 4, 2030.

Outside the U.S.

DD/MM/YYYY

Day, month, and year are commonly used outside the U.S.

05/04/2030

Outside the U.S., we would read this date as April 5, 2030.

The correct document language can prevent errors

Imagine you’re booking a flight for May 4th, but the system interprets the date as April 5th.

If you’re lucky, you may catch that mistake early, but you may have to pay fees to change the flight. At worse, you might not realize the mistake until you get a notification from your airline that it’s time to check-in for your flight on April 5th, a month earlier than when you planned to travel on May 4th.

The system’s interpretation of the date causes avoidable stress, fees, and time to fix it.

A person successfully books a trip online

Correct document language

It lowers the chance of entering the incorrect dates, saving frustration and time.

A person trying to correct their booking mistake by calling a representative

Wrong or missing document language

It can cost time, frustration, and money if it’s even possible to fix the mistake.

How common is missing document language?

15.8%

Missing document language errors affected 15.8% of out of 1 million test home pages. That totals to over 15,800 websites. (2025 WebAIM Study)

How does document language impact you or someone you know?

Which applies to you, your family, a colleague, or another person in your life.

Please reflect on which scenarios apply to you or someone you know:

  • I/they use a screen reader and want to be able to hear content translated and pronounced correctly from other languages
  • I/they travel and want information formatted correctly like dates
  • I/they use international products and sites and want translation services to be more accurate
  • I/they read a symbol-based language like Chinese and need the symbols to look correct when reading
  • I/they don’t need document language

Takeaways

If the document is set to the right language, then the content will reflect the language standards properly and ensures no one will get the wrong information.

We’d love to hear from you.
Help improve our training and take our survey!

Continue learning

Explore our other training

Describe images accessibly, and making them available to everyone

Make link destinations clear for everyone