Mexico - Formatting standards & code snippets

Here is a complete list of standards and formats used in Mexico. It includes a full list of ISO codes, number, date, currency, telephone and address formats. You will also get code examples on how to perform the most common formatting operations in Java, C#, JavaScript and PHP. Multiple resource files are made available, mainly the complete list of states, in different formats such as CSV, XML, JSON, HTML and SQL.

What are the ISO-3166-1 codes for Mexico?

  • Alpha-2: MX
  • Alpha-3: MEX
  • Numeric: 484
  • Java Locale Code: es_MX
  • .Net CultireInfo Code: es-MX
  • PHP Locale Code: es_MX

What is the official language in Mexico?

  • Spanish

What is the date format in Mexico?

The official date format is little-endian, but little-endian is often used:

  • Format: d/MM/yyyy
    Ex: 3/12/2014 for December 31st 2014
How to format dates for Mexico in Java, C#, PHP, and JavaScript

What is the time format in Mexico?

The time format in Mexico is mostly 12-hour notation, but 24-hour format is also commonly adopted.

  • h:mm[:ss] a.m.|p.m.
    Ex: 9:00 a.m. for 09:00AM, and 9:00 p.m. for 09:00PM
How to format time for Mexico in Java, C#, PHP, and JavaScript

What is the numeric format in Mexico?

    Format: 999,999,999.99

  • Group Size: 3
  • Grouping Character: , (Comma)
  • Decimal Character: . (Dot)
How to format numbers for Mexico in Java, C#, PHP, and JavaScript

What is the currency format in Mexico?

    Format: $999,999,999.99

  • Group Size: 3
  • Grouping Character: , (Comma)
  • Decimal Character: . (Dot)
  • Currency Symbol: $
  • Currency Symbol Position: Before number
  • Currency Name: Mexicon Peso (MXN)
How to format currencies for Mexico in Java, C#, PHP, and JavaScript

Download list of states for Mexico in plain text, CSV, JSON, HTML, SQL and XML

List of states: HTML - Select Control

------------------------
 ISO_3166-2 code + name
------------------------
<select>
	<option value="MX-CMX">Mexican Federal District</option>
	<option value="MX-AGU">Aguascalientes</option>
	<option value="MX-BCN">Baja California</option>
	<option value="MX-BCS">Baja California Sur</option>
	<option value="MX-CAM">Campeche</option>
	<option value="MX-COA">Coahuila</option>
	<option value="MX-COL">Colima</option>
	<option value="MX-CHP">Chiapas</option>
	<option value="MX-CHH">Chihuahua</option>
	<option value="MX-DUR">Durango</option>
	<option value="MX-GUA">Guanajuato</option>
	<option value="MX-GRO">Guerrero</option>
	<option value="MX-HID">Hidalgo</option>
	<option value="MX-JAL">Jalisco</option>
	<option value="MX-MEX">México</option>
	<option value="MX-MIC">Michoacán</option>
	<option value="MX-MOR">Morelos</option>
	<option value="MX-NAY">Nayarit</option>
	<option value="MX-NLE">Nuevo León</option>
	<option value="MX-OAX">Oaxaca</option>
	<option value="MX-PUE">Puebla</option>
	<option value="MX-QUE">Querétaro</option>
	<option value="MX-ROO">Quintana Roo</option>
	<option value="MX-SLP">San Luis Potosí</option>
	<option value="MX-SIN">Sinaloa</option>
	<option value="MX-SON">Sonora</option>
	<option value="MX-TAB">Tabasco</option>
	<option value="MX-TAM">Tamaulipas</option>
	<option value="MX-TLA">Tlaxcala</option>
	<option value="MX-VER">Veracruz</option>
	<option value="MX-YUC">Yucatán</option>
	<option value="MX-ZAC">Zacatecas</option>				
</select>

List of states: CSV

code,name
MX-CMX,"Mexican Federal District"
MX-AGU,"Aguascalientes"
MX-BCN,"Baja California"
MX-BCS,"Baja California Sur"
MX-CAM,"Campeche"
MX-COA,"Coahuila"
MX-COL,"Colima"
MX-CHP,"Chiapas"
MX-CHH,"Chihuahua"
MX-DUR,"Durango"
MX-GUA,"Guanajuato"
MX-GRO,"Guerrero"
MX-HID,"Hidalgo"
MX-JAL,"Jalisco"
MX-MEX,"México"
MX-MIC,"Michoacán"
MX-MOR,"Morelos"
MX-NAY,"Nayarit"
MX-NLE,"Nuevo León"
MX-OAX,"Oaxaca"
MX-PUE,"Puebla"
MX-QUE,"Querétaro"
MX-ROO,"Quintana Roo"
MX-SLP,"San Luis Potosí"
MX-SIN,"Sinaloa"
MX-SON,"Sonora"
MX-TAB,"Tabasco"
MX-TAM,"Tamaulipas"
MX-TLA,"Tlaxcala"
MX-VER,"Veracruz"
MX-YUC,"Yucatán"
MX-ZAC,"Zacatecas"

List Of States: JSON

------------------------
 ISO-3166-2 code + Name
------------------------
[
	{code: "MX-CMX", name: "Mexican Federal District"},
	{code: "MX-AGU", name: "Aguascalientes"},
	{code: "MX-BCN", name: "Baja California"},
	{code: "MX-BCS", name: "Baja California Sur"},
	{code: "MX-CAM", name: "Campeche"},
	{code: "MX-COA", name: "Coahuila"},
	{code: "MX-COL", name: "Colima"},
	{code: "MX-CHP", name: "Chiapas"},
	{code: "MX-CHH", name: "Chihuahua"},
	{code: "MX-DUR", name: "Durango"},
	{code: "MX-GUA", name: "Guanajuato"},
	{code: "MX-GRO", name: "Guerrero"},
	{code: "MX-HID", name: "Hidalgo"},
	{code: "MX-JAL", name: "Jalisco"},
	{code: "MX-MEX", name: "México"},
	{code: "MX-MIC", name: "Michoacán"},
	{code: "MX-MOR", name: "Morelos"},
	{code: "MX-NAY", name: "Nayarit"},
	{code: "MX-NLE", name: "Nuevo León"},
	{code: "MX-OAX", name: "Oaxaca"},
	{code: "MX-PUE", name: "Puebla"},
	{code: "MX-QUE", name: "Querétaro"},
	{code: "MX-ROO", name: "Quintana Roo"},
	{code: "MX-SLP", name: "San Luis Potosí"},
	{code: "MX-SIN", name: "Sinaloa"},
	{code: "MX-SON", name: "Sonora"},
	{code: "MX-TAB", name: "Tabasco"},
	{code: "MX-TAM", name: "Tamaulipas"},
	{code: "MX-TLA", name: "Tlaxcala"},
	{code: "MX-VER", name: "Veracruz"},
	{code: "MX-YUC", name: "Yucatán"},
	{code: "MX-ZAC", name: "Zacatecas"}	
]

List of states: SQL

-- -----------------------------------------------------
-- Table `state`
-- -----------------------------------------------------
DROP TABLE IF EXISTS state;

CREATE TABLE IF NOT EXISTS state (
  id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  code VARCHAR(6) NOT NULL,
  name VARCHAR(50) NOT NULL,
  PRIMARY KEY (id),
  UNIQUE INDEX id_UNIQUE (id ASC),
  UNIQUE INDEX code_UNIQUE (code ASC)
) ENGINE = InnoDB;

INSERT INTO state (id, code, name) VALUES (null, 'MX-CMX', 'Mexican Federal District');
INSERT INTO state (id, code, name) VALUES (null, 'MX-AGU', 'Aguascalientes');
INSERT INTO state (id, code, name) VALUES (null, 'MX-BCN', 'Baja California');
INSERT INTO state (id, code, name) VALUES (null, 'MX-BCS', 'Baja California Sur');
INSERT INTO state (id, code, name) VALUES (null, 'MX-CAM', 'Campeche');
INSERT INTO state (id, code, name) VALUES (null, 'MX-COA', 'Coahuila');
INSERT INTO state (id, code, name) VALUES (null, 'MX-COL', 'Colima');
INSERT INTO state (id, code, name) VALUES (null, 'MX-CHP', 'Chiapas');
INSERT INTO state (id, code, name) VALUES (null, 'MX-CHH', 'Chihuahua');
INSERT INTO state (id, code, name) VALUES (null, 'MX-DUR', 'Durango');
INSERT INTO state (id, code, name) VALUES (null, 'MX-GUA', 'Guanajuato');
INSERT INTO state (id, code, name) VALUES (null, 'MX-GRO', 'Guerrero');
INSERT INTO state (id, code, name) VALUES (null, 'MX-HID', 'Hidalgo');
INSERT INTO state (id, code, name) VALUES (null, 'MX-JAL', 'Jalisco');
INSERT INTO state (id, code, name) VALUES (null, 'MX-MEX', 'México');
INSERT INTO state (id, code, name) VALUES (null, 'MX-MIC', 'Michoacán');
INSERT INTO state (id, code, name) VALUES (null, 'MX-MOR', 'Morelos');
INSERT INTO state (id, code, name) VALUES (null, 'MX-NAY', 'Nayarit');
INSERT INTO state (id, code, name) VALUES (null, 'MX-NLE', 'Nuevo León');
INSERT INTO state (id, code, name) VALUES (null, 'MX-OAX', 'Oaxaca');
INSERT INTO state (id, code, name) VALUES (null, 'MX-PUE', 'Puebla');
INSERT INTO state (id, code, name) VALUES (null, 'MX-QUE', 'Querétaro');
INSERT INTO state (id, code, name) VALUES (null, 'MX-ROO', 'Quintana Roo');
INSERT INTO state (id, code, name) VALUES (null, 'MX-SLP', 'San Luis Potosí');
INSERT INTO state (id, code, name) VALUES (null, 'MX-SIN', 'Sinaloa');
INSERT INTO state (id, code, name) VALUES (null, 'MX-SON', 'Sonora');
INSERT INTO state (id, code, name) VALUES (null, 'MX-TAB', 'Tabasco');
INSERT INTO state (id, code, name) VALUES (null, 'MX-TAM', 'Tamaulipas');
INSERT INTO state (id, code, name) VALUES (null, 'MX-TLA', 'Tlaxcala');
INSERT INTO state (id, code, name) VALUES (null, 'MX-VER', 'Veracruz');
INSERT INTO state (id, code, name) VALUES (null, 'MX-YUC', 'Yucatán');
INSERT INTO state (id, code, name) VALUES (null, 'MX-ZAC', 'Zacatecas');

List of states: XML

<!-- ISO-3166-2 code + name -->
<?xml version="1.0" encoding="UTF-8"?>
<states>
	<state>
		<code>MX-CMX</code>
		<name>Mexican Federal District</name>
	</state>
	<state>
		<code>MX-AGU</code>
		<name>Aguascalientes</name>
	</state>
	<state>
		<code>MX-BCN</code>
		<name>Baja California</name>
	</state>
	<state>
		<code>MX-BCS</code>
		<name>Baja California Sur</name>
	</state>
	<state>
		<code>MX-CAM</code>
		<name>Campeche</name>
	</state>
	<state>
		<code>MX-COA</code>
		<name>Coahuila</name>
	</state>
	<state>
		<code>MX-COL</code>
		<name>Colima</name>
	</state>
	<state>
		<code>MX-CHP</code>
		<name>Chiapas</name>
	</state>
	<state>
		<code>MX-CHH</code>
		<name>Chihuahua</name>
	</state>
	<state>
		<code>MX-DUR</code>
		<name>Durango</name>
	</state>
	<state>
		<code>MX-GUA</code>
		<name>Guanajuato</name>
	</state>
	<state>
		<code>MX-GRO</code>
		<name>Guerrero</name>
	</state>
	<state>
		<code>MX-HID</code>
		<name>Hidalgo</name>
	</state>
	<state>
		<code>MX-JAL</code>
		<name>Jalisco</name>
	</state>
	<state>
		<code>MX-MEX</code>
		<name>México</name>
	</state>
	<state>
		<code>MX-MIC</code>
		<name>Michoacán</name>
	</state>
	<state>
		<code>MX-MOR</code>
		<name>Morelos</name>
	</state>
	<state>
		<code>MX-NAY</code>
		<name>Nayarit</name>
	</state>
	<state>
		<code>MX-NLE</code>
		<name>Nuevo León</name>
	</state>
	<state>
		<code>MX-OAX</code>
		<name>Oaxaca</name>
	</state>
	<state>
		<code>MX-PUE</code>
		<name>Puebla</name>
	</state>
	<state>
		<code>MX-QUE</code>
		<name>Querétaro</name>
	</state>
	<state>
		<code>MX-ROO</code>
		<name>Quintana Roo</name>
	</state>
	<state>
		<code>MX-SLP</code>
		<name>San Luis Potosí</name>
	</state>
	<state>
		<code>MX-SIN</code>
		<name>Sinaloa</name>
	</state>
	<state>
		<code>MX-SON</code>
		<name>Sonora</name>
	</state>
	<state>
		<code>MX-TAB</code>
		<name>Tabasco</name>
	</state>
	<state>
		<code>MX-TAM</code>
		<name>Tamaulipas</name>
	</state>
	<state>
		<code>MX-TLA</code>
		<name>Tlaxcala</name>
	</state>
	<state>
		<code>MX-VER</code>
		<name>Veracruz</name>
	</state>
	<state>
		<code>MX-YUC</code>
		<name>Yucatán</name>
	</state>
	<state>
		<code>MX-ZAC</code>
		<name>Zacatecas</name>
	</state>
</states>