Skip to Content

Complete List of US State Codes (ISO 3166-2:US)

This is a complete reference of all US state and territory codes as defined by the ISO 3166-2:US standard. The table below includes all 50 states, the District of Columbia, and US territories. Each entry shows the ISO 3166-2 code, the two-letter region code used in postal addresses, and the state capital.

All 50 US States

ISO CodeRegion CodeStateCapital
US-ALALAlabamaMontgomery
US-AKAKAlaskaJuneau
US-AZAZArizonaPhoenix
US-ARARArkansasLittle Rock
US-CACACaliforniaSacramento
US-COCOColoradoDenver
US-CTCTConnecticutHartford
US-DEDEDelawareDover
US-FLFLFloridaTallahassee
US-GAGAGeorgiaAtlanta
US-HIHIHawaiiHonolulu
US-IDIDIdahoBoise
US-ILILIllinoisSpringfield
US-ININIndianaIndianapolis
US-IAIAIowaDes Moines
US-KSKSKansasTopeka
US-KYKYKentuckyFrankfort
US-LALALouisianaBaton Rouge
US-MEMEMaineAugusta
US-MDMDMarylandAnnapolis
US-MAMAMassachusettsBoston
US-MIMIMichiganLansing
US-MNMNMinnesotaSaint Paul
US-MSMSMississippiJackson
US-MOMOMissouriJefferson City
US-MTMTMontanaHelena
US-NENENebraskaLincoln
US-NVNVNevadaCarson City
US-NHNHNew HampshireConcord
US-NJNJNew JerseyTrenton
US-NMNMNew MexicoSanta Fe
US-NYNYNew YorkAlbany
US-NCNCNorth CarolinaRaleigh
US-NDNDNorth DakotaBismarck
US-OHOHOhioColumbus
US-OKOKOklahomaOklahoma City
US-OROROregonSalem
US-PAPAPennsylvaniaHarrisburg
US-RIRIRhode IslandProvidence
US-SCSCSouth CarolinaColumbia
US-SDSDSouth DakotaPierre
US-TNTNTennesseeNashville
US-TXTXTexasAustin
US-UTUTUtahSalt Lake City
US-VTVTVermontMontpelier
US-VAVAVirginiaRichmond
US-WAWAWashingtonOlympia
US-WVWVWest VirginiaCharleston
US-WIWIWisconsinMadison
US-WYWYWyomingCheyenne

District of Columbia

ISO CodeRegion CodeNameType
US-DCDCDistrict of ColumbiaDistrict

The District of Columbia is the federal district containing the nation’s capital, Washington, D.C. It is classified as a “District” in ISO 3166-2, not a state. For most software purposes (tax calculation, shipping, forms), DC is treated as equivalent to a state.

US Territories

The United States has several outlying territories. These are classified as “Outlying area” in ISO 3166-2:

ISO CodeRegion CodeTerritory
US-ASASAmerican Samoa
US-GUGUGuam
US-MPMPNorthern Mariana Islands
US-PRPRPuerto Rico
US-VIVIVirgin Islands, U.S.
US-UMUMUnited States Minor Outlying Islands

Puerto Rico is the most populous territory with over 3 million residents. For applications involving shipping, taxes, or regulatory compliance, it is important to distinguish between the 50 states, DC, and territories, as different rules may apply.

Looking Up State Data Programmatically

Using @koshmoney/countries, you can look up any US state by its code, name, or get the full list:

import { subdivision } from '@koshmoney/countries'; // Look up by full ISO code subdivision.whereCode('US-CA'); // { code: 'US-CA', name: 'California', type: 'State', // countryCode: 'US', countryName: 'United States', regionCode: 'CA' } // Look up by country + region code subdivision.where('US', 'CA'); // Same result // Look up by name subdivision.whereName('US', 'California'); // Same result // Get all US subdivisions (states + DC + territories) const allUS = subdivision.forCountry('US'); console.log(allUS.length); // 56 // Filter to just the 50 states const states = allUS.filter((s) => s.type === 'State'); console.log(states.length); // 50

Converting Between Formats

import { subdivision } from '@koshmoney/countries'; // Full code to region code subdivision.toRegionCode('US-CA'); // 'CA' // Region code to full code subdivision.toFullCode('US', 'CA'); // 'US-CA' // Code to name subdivision.toName('US-CA'); // 'California' // Code to country subdivision.toCountryCode('US-CA'); // 'US'

Validation

Validate state codes before using them in your application:

import { subdivision } from '@koshmoney/countries'; // Validate a full ISO code subdivision.isValidCode('US-CA'); // true subdivision.isValidCode('US-XX'); // false // Validate a region code for a country subdivision.isValidRegion('US', 'CA'); // true subdivision.isValidRegion('US', 'XX'); // false // Validate by name subdivision.isValidName('US', 'California'); // true subdivision.isValidName('US', 'Narnia'); // false

Common Use Cases

Tax Calculation

US sales tax is determined at the state (and often local) level. Use ISO 3166-2 codes to identify the correct tax jurisdiction:

import { subdivision } from '@koshmoney/countries'; function getTaxRate(stateCode: string): number { // Validate the state code first if (!subdivision.isValidRegion('US', stateCode)) { throw new Error(`Invalid state code: ${stateCode}`); } // Look up tax rate from your database using the standardized code return taxRatesByState[stateCode] ?? 0; }

Shipping Zone Configuration

E-commerce platforms often group states into shipping zones:

import { subdivision } from '@koshmoney/countries'; const shippingZones: Record<string, string[]> = { 'West Coast': ['CA', 'OR', 'WA'], 'Mountain': ['CO', 'UT', 'MT', 'WY', 'ID', 'NV', 'AZ', 'NM'], 'Midwest': ['IL', 'IN', 'IA', 'KS', 'MI', 'MN', 'MO', 'NE', 'ND', 'OH', 'SD', 'WI'], 'Northeast': ['CT', 'DE', 'ME', 'MD', 'MA', 'NH', 'NJ', 'NY', 'PA', 'RI', 'VT'], 'Southeast': ['AL', 'AR', 'FL', 'GA', 'KY', 'LA', 'MS', 'NC', 'SC', 'TN', 'VA', 'WV'], 'Texas': ['TX'], 'Hawaii/Alaska': ['HI', 'AK'], }; function getShippingZone(stateCode: string): string | null { for (const [zone, states] of Object.entries(shippingZones)) { if (states.includes(stateCode)) return zone; } return null; }

Address Forms

When building address forms, populate the state dropdown dynamically:

import { subdivision } from '@koshmoney/countries'; // Get states sorted alphabetically (they already are from the library) const usStates = subdivision.forCountry('US').filter((s) => s.type === 'State'); // For a form select element const options = usStates.map((s) => ({ value: s.regionCode, // 'CA', 'NY', etc. label: s.name, // 'California', 'New York', etc. }));

Validating ZIP Codes by State

Combine state codes with postal code validation for complete address verification:

import { subdivision, postalCode } from '@koshmoney/countries'; function validateUSAddress(state: string, zip: string): boolean { // Validate state code if (!subdivision.isValidRegion('US', state)) { return false; } // Validate ZIP code format if (!postalCode.isValid('US', zip)) { return false; } return true; } validateUSAddress('CA', '90210'); // true validateUSAddress('CA', '90210-1234'); // true (ZIP+4) validateUSAddress('XX', '90210'); // false (invalid state) validateUSAddress('CA', 'ABCDE'); // false (invalid ZIP)

Understanding the Code Format

The ISO 3166-2:US code format is US-{XX}, where XX is a two-letter alphabetic code. This code is the same as the USPS two-letter state abbreviation in all cases. So CA in ISO 3166-2:US is the same CA used on mailing addresses.

The format breaks down as:

  • US — the ISO 3166-1 alpha-2 country code
  • - — a hyphen separator (always present)
  • XX — the two-letter subdivision code

This makes US subdivision codes particularly developer-friendly since they match the widely used USPS abbreviations.

Further Reading

Get Started

Look up any US state code programmatically with @koshmoney/countries:

npm install @koshmoney/countries
import { subdivision } from '@koshmoney/countries'; const california = subdivision.where('US', 'CA'); console.log(california.name); // 'California'

See the full Subdivision API documentation for all available functions.