List of language codes by country

The countryInfo file from ( has names, country codes, languages and lots of other info. It is a tab separated list so awk or any text editor will let you select just the columns you need.

The information you are looking for is actually 2 separate pieces of information. I am not sure there is a direct correlation between the two.

Country codes are available at:

And language codes are available at:

Mixing the pieces of information together is something done in "locales". This seems to be something that is not real standardized. Lots of companies appear to be doing it on their own and even providing utilities for supporting this in things like Java (See

This site has more information on language tags:

BTW, the relationship of country codes to language code is not usually that meaningful in a user application. There are lots of users in a country that use "non-native" languages. (IE: someone in the U.S. that uses Chinese, or vice-versa.)