Main Street Docs

Hindi 2 Letter Code: ISO 639-1 Explained

Updated December 2, 2026

Blank template:PDFWordSample wording, a generic template. Not legal advice; check what applies to you.

The Hindi 2-letter code is hi, as defined by the ISO 639-1 standard. This code is used globally in software, websites, and data systems to identify the Hindi language without spelling out its full name.

What Is ISO 639-1?

ISO 639-1 is an international standard that assigns two-letter codes to major languages of the world. It is maintained by the International Organization for Standardization (ISO) and is the most widely used language code system for web and software localization. Each code is unique and case-insensitive, though lowercase is the convention in most technical contexts. For example, en stands for English, fr for French, and hi for Hindi.

The standard was first published in 1967 and has been updated several times. It covers over 180 languages, focusing on those with significant literary traditions or wide usage. For languages not in ISO 639-1, longer codes from ISO 639-2 (three letters) or ISO 639-3 (three letters for all known languages) are used.

Why Does Hindi Use “hi”?

The code hi is derived from the first two letters of the language’s endonym, Hindī (हिन्दी). This is a common pattern in ISO 639-1: many codes are simply the first two letters of the language name in its own script or romanized form. For instance, de for German (Deutsch) and es for Spanish (Español). The choice avoids favoring any particular English spelling and ties the code to the native name.

It is important to note that hi is distinct from other codes that might appear similar. For example, ur is Urdu, a related language but with a different code. The two-letter code system is flat—each language gets one code—so there is no confusion between Hindi and Hindustani (a colloquial blend), which does not have its own ISO 639-1 code.

How the Hindi Code Is Used in Practice

In web development, the code appears in the lang attribute of HTML tags to indicate the language of content. For example, <html lang="hi"> tells browsers and assistive technologies that the page is in Hindi. It is also used in HTTP headers like Content-Language: hi, in URL paths (e.g., /hi/page), and in translation APIs to specify the target language.

In software localization, the code is combined with a region subtag to form a locale. For Hindi, the most common locale is hi-IN (Hindi as spoken in India), but you may also see hi-Latn for Hindi transliterated in Latin script. These extended codes follow the BCP 47 standard, which builds on ISO 639-1.

Examples of real-world usage:

  • Google Translate uses hi as the language code for Hindi.
  • Wikipedia’s Hindi edition is at hi.wikipedia.org.
  • Many content management systems let you create a Hindi version of your site by setting the language to hi.

How to Choose the Right Code for Your Project

When you need to specify Hindi in a system, you will almost always use hi. However, there are a few considerations:

  1. Check the system’s accepted codes. Some older systems might expect a three-letter code like hin (ISO 639-2). If that is the case, use hin.
  2. Include a region if needed. For most general purposes, hi is sufficient. But if you need to distinguish from other regions (like Hindi in Fiji, which is a different dialect), you might use hi-FJ for Fiji Hindi.
  3. Be consistent. Once you pick a code, use it everywhere in your project—in URLs, database fields, and HTML attributes—to avoid mismatches.

If you are working with a language list for a dropdown, the display name should be “Hindi” while the stored value is hi. This is a common pattern in internationalized applications.

Common Problems and Misconceptions

One common mistake is confusing hi with in. The code in is actually the ISO 3166-1 alpha-2 country code for India, not a language code. In some older systems, you might see in used incorrectly for Hindi, but the correct language code is hi.

Another misconception is that Hindi and Urdu share the same code because they are mutually intelligible in spoken form. They do not: Urdu has its own code ur. The ISO standard treats them as separate languages due to differences in script and literary tradition.

Also, be aware that the code is case-insensitive, but lowercase is the norm. Using uppercase HI might work in some systems but is not standard and can cause issues in case-sensitive environments.

Comparisons with Other Language Codes

To put the Hindi code in context, here are a few other major language codes:

  • en – English
  • hi – Hindi
  • bn – Bengali
  • ta – Tamil
  • te – Telugu
  • mr – Marathi
  • ur – Urdu

These codes are all part of the same ISO 639-1 set. Notice that many Indian languages have codes that are two-letter abbreviations of their native names. This consistency helps developers and linguists work with multiple languages without ambiguity.

Hindi Code Template for Your Project

If you are setting up a language configuration, the following template can help you document the necessary fields. Copy the table below and fill in your project’s details.

Field Value
Language Name (English) Hindi
ISO 639-1 Code hi
ISO 639-2 Code hin
ISO 639-3 Code hin
Locale (with region) hi-IN
Script Devanagari
Native Name हिन्दी

Sample (fictional): For a website targeting Indian users, set the default language to hi-IN and the HTML lang attribute to lang="hi".

This template gives you a quick reference for all the standard codes associated with Hindi. You can adapt it for other languages by changing the values.

Frequently Asked Questions

What is the two-letter code for Hindi?

The two-letter code is hi. It is the ISO 639-1 standard code used in all modern systems.

Is the Hindi code the same as the India country code?

No. The country code for India is IN (ISO 3166-1). The language code for Hindi is hi. They are different standards and should not be used interchangeably.

How do I use the Hindi code in HTML?

Set the lang attribute on the <html> element to hi. For example: <html lang="hi">. If you need to specify the region, use hi-IN.

What if my system only accepts three-letter codes?

Use hin, which is the ISO 639-2 and ISO 639-3 code for Hindi. It is equally standard and recognized.

Can I use the code for Hindi in URL slugs?

Yes, it is common to use hi in URLs to indicate the language version of a page, such as /hi/about. Just ensure your server routes are configured correctly.

Does the code change for different dialects of Hindi?

No, the base code hi covers all dialects. If you need to specify a regional variant, you can add a region subtag, like hi-IN for India or hi-FJ for Fiji Hindi, but this is rarely necessary.

Related