WooCommerce Country Codes & State Codes List

Here is a list of WooCommerce country code and state code data. This data was extracted directly from the WooCommerce plugin and therefore, can be used for tax rate classes and maybe other WooCommerce related plugins that may require a state code or country code.

Note that while the help text mentions that we should use “2 digit state codes”, I have found that some countries have states codes that are longer than 2 digits. I have tested tax rates for Peru with the 3 letter state code “PAS” and it worked.

I believe that my tax calculations wouldn’t worked without that 3 letter code. While my test passed, I still recommend testing such codes prior to using them on a production site just to be sure.

State
State Code
A Coruña
C
Araba/Álava
VI
Albacete
AB
Alicante
A
Almería
AL
Asturias
O
Ávila
AV
Badajoz
BA
Baleares
PM
Barcelona
B
Burgos
BU
Cáceres
CC
Cádiz
CA
Cantabria
S
Castellón
CS
Ceuta
CE
Ciudad Real
CR
Córdoba
CO
Cuenca
CU
Girona
GI
Granada
GR
Guadalajara
GU
Gipuzkoa
SS
Huelva
H
Huesca
HU
Jaén
J
La Rioja
LO
Las Palmas
GC
León
LE
Lleida
L
Lugo
LU
Madrid
M
Málaga
MA
Melilla
ML
Murcia
MU
Navarra
NA
Ourense
OR
Palencia
P
Pontevedra
PO
Salamanca
SA
Santa Cruz de Tenerife
TF
Segovia
SG
Sevilla
SE
Soria
SO
Tarragona
T
Teruel
TE
Toledo
TO
Valencia
V
Valladolid
VA
Bizkaia
BI
Zamora
ZA
Zaragoza
Z