Back to Blog

Mexican State Codes: Complete List of All 32 Subdivisions

Complete list of Mexican state codes (ISO 3166-2:MX). All 31 states and the Federal District with codes, capitals, and TypeScript examples.

Mexican State Codes: Complete List of All 32 Subdivisions

Mexico is divided into 31 states and 1 federal district (Ciudad de Mexico), each with a standardized ISO 3166-2 code. These codes are used in e-commerce, shipping, tax calculations (IVA/IEPS), and any application that handles Mexican addresses.

This page lists every Mexican subdivision code and shows how to work with them using @koshmoney/countries.

All Mexican State Codes

Mexico has 32 ISO 3166-2 entries: 31 states (type "State") and 1 federal district (type "Federal District").

Northern States

CodeNameCapital
MX-BCNBaja CaliforniaMexicali
MX-BCSBaja California SurLa Paz
MX-CHHChihuahuaChihuahua
MX-COACoahuila de ZaragozaSaltillo
MX-DURDurangoDurango
MX-NLENuevo LeonMonterrey
MX-SINSinaloaCuliacan
MX-SONSonoraHermosillo
MX-TAMTamaulipasCiudad Victoria

Central States

CodeNameCapital
MX-AGUAguascalientesAguascalientes
MX-CMXCiudad de Mexico--
MX-GUAGuanajuatoGuanajuato
MX-HIDHidalgoPachuca
MX-JALJaliscoGuadalajara
MX-MEXMexicoToluca
MX-MICMichoacan de OcampoMorelia
MX-MORMorelosCuernavaca
MX-NAYNayaritTepic
MX-PUEPueblaPuebla
MX-QUEQueretaroQueretaro
MX-SLPSan Luis PotosiSan Luis Potosi
MX-TLATlaxcalaTlaxcala
MX-ZACZacatecasZacatecas

Southern States

CodeNameCapital
MX-CAMCampecheCampeche
MX-CHPChiapasTuxtla Gutierrez
MX-COLColimaColima
MX-GROGuerreroChilpancingo
MX-OAXOaxacaOaxaca
MX-ROOQuintana RooChetumal
MX-TABTabascoVillahermosa
MX-VERVeracruz de Ignacio de la LlaveXalapa
MX-YUCYucatanMerida

Understanding Mexican State Codes

Each code follows the ISO 3166-2 format: the country alpha-2 code (MX) followed by a hyphen and a 3-letter state abbreviation.

ComponentExampleMeaning
Country prefixMXMexico
Separator-Standard delimiter
State codeJALJalisco
Full codeMX-JALJalisco, Mexico

[!NOTE] Ciudad de Mexico (MX-CMX) has the type "Federal District" in ISO 3166-2, distinct from the 31 states. Formerly known as Distrito Federal (DF), it was renamed in 2016 and received the new code CMX.

Using Mexican State Codes in Code

Look Up a State

import { subdivision } from '@koshmoney/countries';
 
subdivision.whereCode('MX-JAL');
// { code: 'MX-JAL', name: 'Jalisco', type: 'State', countryCode: 'MX' }
 
subdivision.whereCode('MX-CMX');
// { code: 'MX-CMX', name: 'Ciudad de Mexico', type: 'Federal District', countryCode: 'MX' }

Get All Mexican Subdivisions

import { subdivision } from '@koshmoney/countries';
 
const allMX = subdivision.forCountry('MX');
// Returns array of 32 subdivisions
 
// Build a dropdown
const options = allMX.map(s => ({
  label: s.name,
  value: s.code,
}));

Validate a State Code

import { subdivision } from '@koshmoney/countries';
 
subdivision.isValidCode('MX-NLE');    // true (Nuevo Leon)
subdivision.isValidCode('MX-XXX');    // false
 
subdivision.isValidRegion('MX', 'JAL');  // true (Jalisco)
subdivision.isValidRegion('MX', 'CA');   // false

Tree-Shaking for Mexican Data Only

import '@koshmoney/countries/subdivision/MX';
import { whereCode, forCountry } from '@koshmoney/countries/subdivision';
 
const jalisco = whereCode('MX-JAL');
const allStates = forCountry('MX');

Postal Code System

Mexico uses a 5-digit postal code (Codigo Postal or CP). The first two digits indicate the state:

First DigitsState
01-05Ciudad de Mexico (CMX)
06-09Mexico (MEX)
10-11Aguascalientes (AGU)
20-21Aguascalientes / San Luis Potosi
22-23Baja California (BCN)
24-25Campeche (CAM)
28-30Coahuila (COA)
31-33Chihuahua (CHH)
36-38Guanajuato (GUA)
44-49Jalisco (JAL)
64-67Nuevo Leon (NLE)
72-75Puebla (PUE)
76-78Queretaro (QUE)
import { postalCode } from '@koshmoney/countries';
 
postalCode.isValid('MX', '06600');  // true (Ciudad de Mexico)
postalCode.isValid('MX', '44100');  // true (Guadalajara, Jalisco)
postalCode.isValid('MX', '1234');   // false (only 4 digits)

Currency and Country Data

import { country } from '@koshmoney/countries';
import { currency } from '@koshmoney/countries/currency';
import { geography } from '@koshmoney/countries/geography';
 
country.whereAlpha2('MX');
// { name: 'Mexico', alpha2: 'MX', alpha3: 'MEX', numeric: '484' }
 
currency.getCurrency('MX');
// { code: 'MXN', symbol: 'MX$', name: 'Mexican Peso' }
 
geography.getContinent('MX');  // 'North America'
geography.getRegion('MX');     // 'Central America'

Common Use Cases

Tax Calculation (IVA)

Mexico has a standard IVA (Impuesto al Valor Agregado) rate of 16%, but border zone states have a reduced rate of 8%. State codes help determine the applicable rate:

const borderZoneStates = new Set([
  'MX-BCN', // Baja California
  'MX-BCS', // Baja California Sur
  'MX-SON', // Sonora
  'MX-CHH', // Chihuahua (border municipalities)
  'MX-COA', // Coahuila (border municipalities)
  'MX-TAM', // Tamaulipas (border municipalities)
  'MX-NLE', // Nuevo Leon (border municipalities)
]);
 
function getIVARate(stateCode: string): number {
  // Note: actual border zone eligibility depends on municipality, not just state
  return borderZoneStates.has(stateCode) ? 8 : 16;
}

CFDI Invoice Generation

Mexican electronic invoices (CFDI) require the RFC and state code for tax compliance. The ISO state code maps to the SAT catalog:

import { subdivision } from '@koshmoney/countries';
 
function validateInvoiceState(stateCode: string): boolean {
  return subdivision.isValidCode(stateCode);
}

Shipping Zones

Mexican logistics providers define shipping zones by region:

function getShippingZone(stateCode: string): string {
  const metro = ['MX-CMX', 'MX-MEX'];
  const north = ['MX-BCN', 'MX-BCS', 'MX-SON', 'MX-CHH', 'MX-COA', 'MX-NLE', 'MX-TAM', 'MX-DUR', 'MX-SIN'];
 
  if (metro.includes(stateCode)) return 'metro';
  if (north.includes(stateCode)) return 'north';
  return 'standard';
}