1. Home
  2. /Glossary
  3. /What is your country code

What Is Your Country Code? Find Your ISO Country Code (Full Guide)

This guide covers ISO country codes, the letter codes like US and JP.

Updated 24 August 2026Standard: ISO 3166-16 min read

Quick answer

Your country code is the two-letter ISO 3166-1 alpha-2 code for the country you are in: US for the United States, GB for the United Kingdom, IN for India, DE for Germany, JP for Japan. It appears in website domains (.uk, .de), shipping addresses, and the data behind nearly every app. To find yours instantly, use an IP lookup: IPstack’s Find IP Location tool, or the API’s /check endpoint, returns the country_code for your current connection. Note the distinction: US is an ISO country code, while +1 is a country calling code used for dialing phones.

Key takeaways

  • Country codes here means ISO 3166-1 alpha-2 codes: two-letter identifiers (US, GB, JP) assigned by the International Organization for Standardization; 249 codes are currently listed.
  • You see them everywhere: country domains (.fr, .jp), locale settings (en-US), shipping labels, passports, and the country_code field in APIs and databases.
  • Three-letter alpha-3 codes (USA, GBR, JPN) and numeric codes also exist in ISO 3166 for contexts needing more distinct identifiers.
  • ISO codes are not dialing codes: GB is the UK’s ISO code, +44 is its calling code; see our country calling codes guide for the phone system.
  • The fastest way to find your own code is an IP lookup: IPstack’s /check endpoint returns country_code for the connection making the request.

Common ISO country codes

The twenty most-looked-up ISO 3166-1 codes. The standard lists 249 in total.
CountryAlpha-2Alpha-3
United StatesUSUSA
IndiaININD
United KingdomGBGBR
ChinaCNCHN
GermanyDEDEU
JapanJPJPN
FranceFRFRA
BrazilBRBRA
SpainESESP
MexicoMXMEX
ItalyITITA
AustraliaAUAUS
NetherlandsNLNLD
CanadaCACAN
PakistanPKPAK
NigeriaNGNGA
BangladeshBDBGD
South AfricaZAZAF
PhilippinesPHPHL
IndonesiaIDIDN

What is a Country Code?

Scope

This guide covers ISO country codes, the letter codes like US and JP. For telephone dial codes like +1 and +44, see our guide to country code numbers.

A country code is a two-letter code uniquely identifying a country or territory. The International Organization for Standardization (ISO) defines these codes in the ISO 3166 standard. Each code is a unique identifier that helps identify a specific country or territory in various contexts, such as internet domain names, international telephone dialing codes, and vehicle registration plates.

How are country codes used?

Country codes are used in a variety of ways, including:

Country code top-level domains (ccTLDs) identify websites associated with specific countries or territories. For example, websites from the United Kingdom use the “.uk” domain extension, while websites from Germany use “.de.”

Country codes are part of international telephone numbers to indicate the country or territory of the phone number’s location. For example, the country code for the United States is “+1”, while the country code for Japan is “+81”.

In some countries, country codes indicate the country or territory of registration on vehicle registration plates. These codes are typically displayed as an international vehicle registration code (e.g., “USA” for the United States).

Country codes are sometimes used in international mailing addresses to indicate the country or territory of the recipient.

Why are they important?

Country codes are important because they provide a standardized way to identify countries and territories in various contexts. They help avoid confusion, especially in international communications, where countries may have similar names or abbreviations.

Find your country code with IPstack

The direct answer to this page’s title question is one request. IPstack’s /check endpoint geolocates the IP the request comes from and returns its ISO code:

https://api.ipstack.com/check?access_key=YOUR_ACCESS_KEY&fields=country_code,country_name,location.calling_code
// example response:
// { "country_code": "IN", "country_name": "India",
//   "location": { "calling_code": "91" } }

Applications use this everywhere: selecting the right locale and currency, pre-filling country dropdowns on checkout forms, applying regional compliance rules, and routing users to the right storefront. One lookup returns the ISO code, the country name, and the dialing code together. A free API key covers testing and small projects.

Popular questions and prompts about country codes

These are the highest-demand questions and prompt patterns people type into Google and AI assistants about country codes right now.

“How do I find my country code?”

For your ISO code, check the table above or run an IP lookup: IPstack’s Find IP Location tool or the /check endpoint returns country_code for your connection. For your phone dialing code, see our calling codes guide; the two systems are different (US vs +1).

“Why is the UK’s country code GB and not UK?”

ISO 3166 uses GB, from Great Britain, as the official alpha-2 code for the United Kingdom; UK is reserved by ISO so no other country can use it, and it appears informally (like the .uk domain), but data systems should use GB.

“What is the difference between alpha-2 and alpha-3 codes?”

Both come from ISO 3166-1: alpha-2 codes are two letters (JP) and dominate domains, locales, and APIs; alpha-3 codes are three letters (JPN) and favor human readability, common in statistics, sports, and passports. They map one-to-one.

“Is a country code the same as a dialing code?”

No. An ISO country code (DE) identifies a country in data and domains; a dialing or calling code (+49) routes international phone calls and is assigned by the ITU, not ISO. Germany illustrates the difference: DE for data, +49 for phones.

Prompt: “Detect my user’s country in code”

A pattern that works well with AI coding assistants. Naming the fields, caching, and fallback is the biggest quality lever.

In my [Next.js] app, detect each visitor’s country server-side by calling the IPstack API with their IP and fields=country_code,country_name (key in an environment variable), cache per IP for a day, use the ISO code to set locale and currency, and default to US if the lookup fails.

FAQs

The International Organization for Standardization (ISO) assigns country codes in ISO 3166 based on the names of countries and territories. Alpha-2 codes are two letters; alpha-3 and numeric codes exist alongside them so each country has a stable identifier in data, domains, and official documents.

No. ISO alpha-2 codes (US, JP) identify a country in data and domains. Country calling codes are used to dial international telephone numbers and are one to three digits long; the most-used codes are short (+1, +44, +91) and three-digit codes like +995 (Georgia) are assigned to smaller numbering zones.

Currently, 249 official country or territory codes are listed in the ISO 3166 standard. That count covers the alpha-2 list this page uses; alpha-3 and numeric codes map to the same set of entries.

Yes; when countries change, codes follow. For example, ISO retired CS after the dissolution of Serbia and Montenegro and assigned RS (Serbia) and ME (Montenegro) in 2006. New codes are also assigned when territories gain independence.

Some countries and territories also have three-letter country codes, known as ISO alpha-3 codes, used where a more distinct identifier is helpful (USA, GBR, JPN). They sit beside alpha-2 rather than replacing it; they are not a license to invent unofficial two-letter codes.

Sources

  • ISO 3166-1 — Codes for the representation of names of countries and their subdivisions. iso.org
  • ITU-T E.164 — The international public telecommunication numbering plan, which assigns calling codes. itu.int

Related guides

Resolve a visitor's country code from their IP

One call to /check returns the ISO code, the country name and the calling code together. The free plan is 100 requests a month.