Introduction to ISO 639 Language Codes and Where to Find Them

Learn about ISO 639 language code sets, their implementation in HTML, and where to find a (mostly) comprehensive code list.

  • Subject(s):

    Ebook Production, Website Accessibility

  • Resource Type(s):

    Standards and Best Practices

  • Audience:

    Introduction

What is ISO 639?

The International Organization for Standardization develops standards in technical and nontechnical fields and comprises of representatives from standards committees across various countries around the world.

ISO 639 is a series of international standards for language codes. The first part of the series is ISO 639-1, which consists of registered two-letter codes covering the world’s major languages. For example, “en” for English or “fr” for French.

What is the difference between two-letter versus three-letter codes?

To add more specificity regarding languages or language groups, the ISO 639-2 code set was released, containing all languages in ISO 639-1, as well as additional languages and language groups with three-letter codes. Subsequent code set releases are ISO 639-3 and ISO-639-5, covering more languages. Examples of three-letter codes include “cmn” for Mandarin Chinese and “gwi” for Gwich’in.

It is advised to use two-letter codes for language shifts if they exist for a particular language. Three-letter codes should only be used if a two-letter equivalent does not exist.

How are language codes applied in HTML?

Language tags are applied in HTML web pages or EPUBs to meet the following WCAG 2.2 (Web Content Accessibility Guidelines) criteria:

  • 3.1.1 – Language of Page
  • 3.1.2 – Language of Parts

The Language of Page requirement involves declaring the primary language of a webpage using the lang attribute in the <html> tag. This signals screen readers to switch to a specific language and pronunciation. For a webpage in Spanish, the language would be declared as follows:

<html lang="es">

</html>

An EPUB XHTML page in Canadian English would be declared as follows:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en-CA" xml:lang="en-CA">

</html>

The Language of Parts requirement involves declaring the language of words, phrases, or passages in other languages within an HTML webpage or document (when said language shift is different from the primary language of the page). Exceptions include proper names (e.g., Marcel Proust), technical terms (e.g., zeitgeist), or words/phrases that are common in English (or the main language of the page) (e.g., schadenfreude, rendezvous, etc.).

For example, a shift for a French language phrase within a page in an EPUB would be identified as follows:

<span lang="fr" xml:lang="fr">Je t’aimerai toujours</span>

Currently, screen reader support for language tags is limited to mostly major languages of the world. This is expected to change as technology evolves to prioritize digital accessibility and inclusion.

Where can I find the list of language codes?

There are several code sets of ISO 639, and different Registration Authorities for the sets (note that ISO 639-4 consists of implementation guidelines and ISO 639-6 standard was withdrawn). Refer to the links below for official code lists for each standard set:

ISO 639-1 and ISO 639-2

Registration Authority: Library of Congress

ISO 639-3

Registration Authority: SIL International (Recommended by APLN as the codes on this site are filterable by code set (1-5), identifier, language name, scope, and type).

ISO 639-5

Registration Authority: Library of Congress

Next Steps

1

Web Accessibility Standards

Web Accessibility Standards, Requirements, & Legislation (including WCAG)

The standards for web accessibility are complex, it’s true. This resource discusses the rules in Canada, and breaks down exactly what is needed to meet the all-important Web Content Accessibility Guidelines (WCAG). Even when simplified,…

Subject(s): Website Accessibility
Resource Type(s): Standards and Best Practices
Audience:
Technical
2

Final Ebook Quality Assurance (QA) Pass

Quality Assurance of Completed Ebooks

Once your ebook has been created, it is time to do a quality assurance check for accessibility. This resource contains both simplified and advanced checklists to help you review your ebooks.

Subject(s): Ebook Production
Resource Type(s): Checklist
Audience:
Introduction

Content Source Acknowledgement

Accessibility and Usability at Penn State: Language Tags in HTML

Library of Congress: Codes for the Representation of Names of Languages

Want to discuss this resource?