Brazil - Formatting standards & code snippets
Here is a complete list of standards and formats used in Brazil. 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 Brazil?
- Alpha-2: BR
- Alpha-3: BRA
- Numeric: 076
- Java Locale Code: pt_BR
- .Net CultureInfo Code: pt-BR
- PHP Locale Code: pt_BR
What is the official language in Brazil?
- Portuguese
What is the date format in Brazil?
The date format in Brazil is little-endian:
- Format: d/M/yyyy
Ex: 3/12/2014 for December 3rd 2014
Formatting a date in Java:
Locale locale = new Locale("pt", "BR");
SimpleDateFormat sdf = new SimpleDateFormat("d/M/yyyy", locale); // or dd/MM/yyyy
sdf.format(new Date());
Formatting a date in C#:
CultureInfo ci = CultureInfo.GetCultureInfo("pt-BR");
DateTime.Now.ToString("d/M/yyyy", ci); // or dd/MM/yyyy
Formatting a date in JavaScript:
let date = new Date();
date.toLocaleDateString('pt-BR');
Formatting a date in PHP:
date("d/n/Y")
What is the time format in Brazil?
The time format in Brazil is mostly 24-hour notation.
- Format: HH:mm[:ss]
Ex: 09:00 for 09:00 AM and 21:00 for 9:00 PM
Formatting time in Java:
Locale locale = new Locale("pt", "BR");
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", locale);
sdf.format(new Date());
Formatting time in C#:
CultureInfo ci = CultureInfo.GetCultureInfo("pt-BR");
DateTime.Now.ToString("HH:mm:ss", ci);
Formatting time in JavaScript:
let date = new Date();
date.toLocaleTimeString('pt-BR', {hour12: false});
Formatting time in PHP:
date("H:i:s")
What is the numeric format in Brazil?
- Format: 999.999.999,99
- Group Size: 3
- Grouping Character: . (dot)
- Decimal Character: , (comma)
Formatting numbers in Java:
Locale locale = new Locale("pt", "BR");
NumberFormat numberFormat = NumberFormat.getNumberInstance(locale);
numberFormat.format(999999999.99d);
Formatting numbers in C#:
double d = 999999999.99d;
d.ToString("n", CultureInfo.GetCultureInfo("pt-BR")));
Formatting numbers in JavaScript:
let number = 999999999.99;
number.toLocaleString('pt-BR');
Formatting numbers in PHP:
$fmt = new NumberFormatter($locale = 'pt_BR', NumberFormatter::DECIMAL);
$fmt->format(999999999.99);
What is the currency format in Brazil?
- Format: R$ 999.999.999,99
- Group Size: 3
- Grouping Character: . (dot)
- Decimal Character: , (comma)
- Currency Symbol: R$
- Currency Symbol Position: Before number
- Currency Name: Brazilian Dollar (AUD)
Formatting currency in Java:
Locale locale = new Locale("pt", "BR");
NumberFormat numberFormat = NumberFormat.getCurrencyInstance(locale);
numberFormat.format(999999999.99d);
Formatting currency in C#:
double d = 999999999.99d;
d.ToString("c", CultureInfo.GetCultureInfo("pt-BR")));
Formatting currency in JavaScript:
let number = 999999999.99;
number.toLocaleString('pt-BR', {currency: 'BRL', style: 'currency'});
Formatting currency in PHP:
$fmt = new NumberFormatter($locale = 'pt_BR', NumberFormatter::CURRENCY);
$fmt->format(999999999.99);
Download list of states for Brazil in CSV, JSON, HTML, SQL and XML
List of states: HTML - Select Control
----------------------------
Alpha-2 code + Alpha-2 code
----------------------------
<select>
<option value="AC,"AC</option>
<option value="AL,"AL</option>
<option value="AP,"AP</option>
<option value="AM,"AM</option>
<option value="BA,"BA</option>
<option value="CE,"CE</option>
<option value="DF,"DF</option>
<option value="ES,"ES</option>
<option value="GO,"GO</option>
<option value="MA,"MA</option>
<option value="MT,"MT</option>
<option value="MS,"MS</option>
<option value="MG,"MG</option>
<option value="PA,"PA</option>
<option value="PB,"PB</option>
<option value="PR,"PR</option>
<option value="PE,"PE</option>
<option value="PI,"PI</option>
<option value="RJ,"RJ</option>
<option value="RN,"RN</option>
<option value="RS,"RS</option>
<option value="RO,"RO</option>
<option value="RR,"RR</option>
<option value="SC,"SC</option>
<option value="SP,"SP</option>
<option value="SE,"SE</option>
<option value="TO,"TO</option>
</select>
----------------------------------
Alpha-2 code + name - Portuguese
----------------------------------
<select>
<option value="AC,"Acre</option>
<option value="AL,"Alagoas</option>
<option value="AP,"Amapá</option>
<option value="AM,"Amazonas</option>
<option value="BA,"Bahia</option>
<option value="CE,"Ceará</option>
<option value="DF,"Distrito Federal</option>
<option value="ES,"Espírito Santo</option>
<option value="GO,"Goiás</option>
<option value="MA,"Maranhão</option>
<option value="MT,"Mato Grosso</option>
<option value="MS,"Mato Grosso do Sul</option>
<option value="MG,"Minas Gerais</option>
<option value="PA,"Pará</option>
<option value="PB,"Paraíba</option>
<option value="PR,"Paraná</option>
<option value="PE,"Pernambuco</option>
<option value="PI,"Piauí</option>
<option value="RJ,"Rio de Janeiro</option>
<option value="RN,"Rio Grande do Norte</option>
<option value="RS,"Rio Grande do Sul</option>
<option value="RO,"Rondônia</option>
<option value="RR,"Roraima</option>
<option value="SC,"Santa Catarina</option>
<option value="SP,"São Paulo</option>
<option value="SE,"Sergipe</option>
<option value="TO,"Tocantins</option>
</select>
-------------------------------------
ISO_3166-2 code + name - Portuguese
-------------------------------------
<select>
<option value="BR-AC,"Acre</option>
<option value="BR-AL,"Alagoas</option>
<option value="BR-AP,"Amapá</option>
<option value="BR-AM,"Amazonas</option>
<option value="BR-BA,"Bahia</option>
<option value="BR-CE,"Ceará</option>
<option value="BR-DF,"Distrito Federal</option>
<option value="BR-ES,"Espírito Santo</option>
<option value="BR-GO,"Goiás</option>
<option value="BR-MA,"Maranhão</option>
<option value="BR-MT,"Mato Grosso</option>
<option value="BR-MS,"Mato Grosso do Sul</option>
<option value="BR-MG,"Minas Gerais</option>
<option value="BR-PA,"Pará</option>
<option value="BR-PB,"Paraíba</option>
<option value="BR-PR,"Paraná</option>
<option value="BR-PE,"Pernambuco</option>
<option value="BR-PI,"Piauí</option>
<option value="BR-RJ,"Rio de Janeiro</option>
<option value="BR-RN,"Rio Grande do Norte</option>
<option value="BR-RS,"Rio Grande do Sul</option>
<option value="BR-RO,"Rondônia</option>
<option value="BR-RR,"Roraima</option>
<option value="BR-SC,"Santa Catarina</option>
<option value="BR-SP,"São Paulo</option>
<option value="BR-SE,"Sergipe</option>
<option value="BR-TO,"Tocantins</option>
</select>
List of states: CSV
----------------------------------
Alpha-2 code + name - Portuguese
----------------------------------
code,name
AC,"Acre"
AL,"Alagoas"
AP,"Amapá"
AM,"Amazonas"
BA,"Bahia"
CE,"Ceará"
DF,"Distrito Federal"
ES,"Espírito Santo"
GO,"Goiás"
MA,"Maranhão"
MT,"Mato Grosso"
MS,"Mato Grosso do Sul"
MG,"Minas Gerais"
PA,"Pará"
PB,"Paraíba"
PR,"Paraná"
PE,"Pernambuco"
PI,"Piauí"
RJ,"Rio de Janeiro"
RN,"Rio Grande do Norte"
RS,"Rio Grande do Sul"
RO,"Rondônia"
RR,"Roraima"
SC,"Santa Catarina"
SP,"São Paulo"
SE,"Sergipe"
TO,"Tocantins"
-------------------------------------
ISO_3166-2 code + name - Portuguese
-------------------------------------
code,name
BR-AC,"Acre"
BR-AL,"Alagoas"
BR-AP,"Amapá"
BR-AM,"Amazonas"
BR-BA,"Bahia"
BR-CE,"Ceará"
BR-DF,"Distrito Federal"
BR-ES,"Espírito Santo"
BR-GO,"Goiás"
BR-MA,"Maranhão"
BR-MT,"Mato Grosso"
BR-MS,"Mato Grosso do Sul"
BR-MG,"Minas Gerais"
BR-PA,"Pará"
BR-PB,"Paraíba"
BR-PR,"Paraná"
BR-PE,"Pernambuco"
BR-PI,"Piauí"
BR-RJ,"Rio de Janeiro"
BR-RN,"Rio Grande do Norte"
BR-RS,"Rio Grande do Sul"
BR-RO,"Rondônia"
BR-RR,"Roraima"
BR-SC,"Santa Catarina"
BR-SP,"São Paulo"
BR-SE,"Sergipe"
BR-TO,"Tocantins"
List of states: JSON
-------------------------------
Alpha-2 code + Name - English
-------------------------------
[
{code: "AC", name: "Acre"},
{code: "AL", name: "Alagoas"},
{code: "AP", name: "Amapá"},
{code: "AM", name: "Amazonas"},
{code: "BA", name: "Bahia"},
{code: "CE", name: "Ceará"},
{code: "DF", name: "Distrito Federal"},
{code: "ES", name: "Espírito Santo"},
{code: "GO", name: "Goiás"},
{code: "MA", name: "Maranhão"},
{code: "MT", name: "Mato Grosso"},
{code: "MS", name: "Mato Grosso do Sul"},
{code: "MG", name: "Minas Gerais"},
{code: "PA", name: "Pará"},
{code: "PB", name: "Paraíba"},
{code: "PR", name: "Paraná"},
{code: "PE", name: "Pernambuco"},
{code: "PI", name: "Piauí"},
{code: "RJ", name: "Rio de Janeiro"},
{code: "RN", name: "Rio Grande do Norte"},
{code: "RS", name: "Rio Grande do Sul"},
{code: "RO", name: "Rondônia"},
{code: "RR", name: "Roraima"},
{code: "SC", name: "Santa Catarina"},
{code: "SP", name: "São Paulo"},
{code: "SE", name: "Sergipe"},
{code: "TO", name: "Tocantins"}
]
----------------------------------
ISO-3166-2 code + Name - English
----------------------------------
[
{code: "BR-AC", name: "Acre"},
{code: "BR-AL", name: "Alagoas"},
{code: "BR-AP", name: "Amapá"},
{code: "BR-AM", name: "Amazonas"},
{code: "BR-BA", name: "Bahia"},
{code: "BR-CE", name: "Ceará"},
{code: "BR-DF", name: "Distrito Federal"},
{code: "BR-ES", name: "Espírito Santo"},
{code: "BR-GO", name: "Goiás"},
{code: "BR-MA", name: "Maranhão"},
{code: "BR-MT", name: "Mato Grosso"},
{code: "BR-MS", name: "Mato Grosso do Sul"},
{code: "BR-MG", name: "Minas Gerais"},
{code: "BR-PA", name: "Pará"},
{code: "BR-PB", name: "Paraíba"},
{code: "BR-PR", name: "Paraná"},
{code: "BR-PE", name: "Pernambuco"},
{code: "BR-PI", name: "Piauí"},
{code: "BR-RJ", name: "Rio de Janeiro"},
{code: "BR-RN", name: "Rio Grande do Norte"},
{code: "BR-RS", name: "Rio Grande do Sul"},
{code: "BR-RO", name: "Rondônia"},
{code: "BR-RR", name: "Roraima"},
{code: "BR-SC", name: "Santa Catarina"},
{code: "BR-SP", name: "São Paulo"},
{code: "BR-SE", name: "Sergipe"},
{code: "BR-TO", name: "Tocantins"}
]
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;
-- Alpha-2
INSERT INTO state (id, code, name) VALUES (null, 'AC', 'Acre');
INSERT INTO state (id, code, name) VALUES (null, 'AL', 'Alagoas');
INSERT INTO state (id, code, name) VALUES (null, 'AP', 'Amapá');
INSERT INTO state (id, code, name) VALUES (null, 'AM', 'Amazonas');
INSERT INTO state (id, code, name) VALUES (null, 'BA', 'Bahia');
INSERT INTO state (id, code, name) VALUES (null, 'CE', 'Ceará');
INSERT INTO state (id, code, name) VALUES (null, 'DF', 'Distrito Federal');
INSERT INTO state (id, code, name) VALUES (null, 'ES', 'Espírito Santo');
INSERT INTO state (id, code, name) VALUES (null, 'GO', 'Goiás');
INSERT INTO state (id, code, name) VALUES (null, 'MA', 'Maranhão');
INSERT INTO state (id, code, name) VALUES (null, 'MT', 'Mato Grosso');
INSERT INTO state (id, code, name) VALUES (null, 'MS', 'Mato Grosso do Sul');
INSERT INTO state (id, code, name) VALUES (null, 'MG', 'Minas Gerais');
INSERT INTO state (id, code, name) VALUES (null, 'PA', 'Pará');
INSERT INTO state (id, code, name) VALUES (null, 'PB', 'Paraíba');
INSERT INTO state (id, code, name) VALUES (null, 'PR', 'Paraná');
INSERT INTO state (id, code, name) VALUES (null, 'PE', 'Pernambuco');
INSERT INTO state (id, code, name) VALUES (null, 'PI', 'Piauí');
INSERT INTO state (id, code, name) VALUES (null, 'RJ', 'Rio de Janeiro');
INSERT INTO state (id, code, name) VALUES (null, 'RN', 'Rio Grande do Norte');
INSERT INTO state (id, code, name) VALUES (null, 'RS', 'Rio Grande do Sul');
INSERT INTO state (id, code, name) VALUES (null, 'RO', 'Rondônia');
INSERT INTO state (id, code, name) VALUES (null, 'RR', 'Roraima');
INSERT INTO state (id, code, name) VALUES (null, 'SC', 'Santa Catarina');
INSERT INTO state (id, code, name) VALUES (null, 'SP', 'São Paulo');
INSERT INTO state (id, code, name) VALUES (null, 'SE', 'Sergipe');
INSERT INTO state (id, code, name) VALUES (null, 'TO', 'Tocantins');
-- ISO-3166-2
INSERT INTO state (id, code, name) VALUES (null, 'BR-AC', 'Acre');
INSERT INTO state (id, code, name) VALUES (null, 'BR-AL', 'Alagoas');
INSERT INTO state (id, code, name) VALUES (null, 'BR-AP', 'Amapá');
INSERT INTO state (id, code, name) VALUES (null, 'BR-AM', 'Amazonas');
INSERT INTO state (id, code, name) VALUES (null, 'BR-BA', 'Bahia');
INSERT INTO state (id, code, name) VALUES (null, 'BR-CE', 'Ceará');
INSERT INTO state (id, code, name) VALUES (null, 'BR-DF', 'Distrito Federal');
INSERT INTO state (id, code, name) VALUES (null, 'BR-ES', 'Espírito Santo');
INSERT INTO state (id, code, name) VALUES (null, 'BR-GO', 'Goiás');
INSERT INTO state (id, code, name) VALUES (null, 'BR-MA', 'Maranhão');
INSERT INTO state (id, code, name) VALUES (null, 'BR-MT', 'Mato Grosso');
INSERT INTO state (id, code, name) VALUES (null, 'BR-MS', 'Mato Grosso do Sul');
INSERT INTO state (id, code, name) VALUES (null, 'BR-MG', 'Minas Gerais');
INSERT INTO state (id, code, name) VALUES (null, 'BR-PA', 'Pará');
INSERT INTO state (id, code, name) VALUES (null, 'BR-PB', 'ParaĆba');
INSERT INTO state (id, code, name) VALUES (null, 'BR-PR', 'Paraná');
INSERT INTO state (id, code, name) VALUES (null, 'BR-PE', 'Pernambuco');
INSERT INTO state (id, code, name) VALUES (null, 'BR-PI', 'Piauí');
INSERT INTO state (id, code, name) VALUES (null, 'BR-RJ', 'Rio de Janeiro');
INSERT INTO state (id, code, name) VALUES (null, 'BR-RN', 'Rio Grande do Norte');
INSERT INTO state (id, code, name) VALUES (null, 'BR-RS', 'Rio Grande do Sul');
INSERT INTO state (id, code, name) VALUES (null, 'BR-RO', 'Rondônia');
INSERT INTO state (id, code, name) VALUES (null, 'BR-RR', 'Roraima');
INSERT INTO state (id, code, name) VALUES (null, 'BR-SC', 'Santa Catarina');
INSERT INTO state (id, code, name) VALUES (null, 'BR-SP', 'São Paulo');
INSERT INTO state (id, code, name) VALUES (null, 'BR-SE', 'Sergipe');
INSERT INTO state (id, code, name) VALUES (null, 'BR-TO', 'Tocantins');
List of states: XML
<!-- Alpha-2 code + name - Portuguese -->
<?xml version="1.0" encoding="UTF-8"?>
<states>
<state>
<code>AC</code>
<name>Acre</name>
</state>
<state>
<code>AL</code>
<name>Alagoas</name>
</state>
<state>
<code>AP</code>
<name>Amapá</name>
</state>
<state>
<code>AM</code>
<name>Amazonas</name>
</state>
<state>
<code>BA</code>
<name>Bahia</name>
</state>
<state>
<code>CE</code>
<name>Ceará</name>
</state>
<state>
<code>DF</code>
<name>Distrito Federal</name>
</state>
<state>
<code>ES</code>
<name>Espírito Santo</name>
</state>
<state>
<code>GO</code>
<name>Goiás</name>
</state>
<state>
<code>MA</code>
<name>Maranhão</name>
</state>
<state>
<code>MT</code>
<name>Mato Grosso</name>
</state>
<state>
<code>MS</code>
<name>Mato Grosso do Sul</name>
</state>
<state>
<code>MG</code>
<name>Minas Gerais</name>
</state>
<state>
<code>PA</code>
<name>Pará</name>
</state>
<state>
<code>PB</code>
<name>Paraíba</name>
</state>
<state>
<code>PR</code>
<name>Paraná</name>
</state>
<state>
<code>PE</code>
<name>Pernambuco</name>
</state>
<state>
<code>PI</code>
<name>Piauí</name>
</state>
<state>
<code>RJ</code>
<name>Rio de Janeiro</name>
</state>
<state>
<code>RN</code>
<name>Rio Grande do Norte</name>
</state>
<state>
<code>RS</code>
<name>Rio Grande do Sul</name>
</state>
<state>
<code>RO</code>
<name>Rondônia</name>
</state>
<state>
<code>RR</code>
<name>Roraima</name>
</state>
<state>
<code>SC</code>
<name>Santa Catarina</name>
</state>
<state>
<code>SP</code>
<name>São Paulo</name>
</state>
<state>
<code>SE</code>
<name>Sergipe</name>
</state>
<state>
<code>TO</code>
<name>Tocantins</name>
</state>
</states>
<!-- ISO 3166-2 code + name - English -->
<?xml version="1.0" encoding="UTF-8"?>
<states>
<state>
<code>BR-AC</code>
<name>Acre</name>
</state>
<state>
<code>BR-AL</code>
<name>Alagoas</name>
</state>
<state>
<code>BR-AP</code>
<name>Amapá</name>
</state>
<state>
<code>BR-AM</code>
<name>Amazonas</name>
</state>
<state>
<code>BR-BA</code>
<name>Bahia</name>
</state>
<state>
<code>BR-CE</code>
<name>Ceará</name>
</state>
<state>
<code>BR-DF</code>
<name>Distrito Federal</name>
</state>
<state>
<code>BR-ES</code>
<name>Espírito Santo</name>
</state>
<state>
<code>BR-GO</code>
<name>Goiás</name>
</state>
<state>
<code>BR-MA</code>
<name>Maranhão</name>
</state>
<state>
<code>BR-MT</code>
<name>Mato Grosso</name>
</state>
<state>
<code>BR-MS</code>
<name>Mato Grosso do Sul</name>
</state>
<state>
<code>BR-MG</code>
<name>Minas Gerais</name>
</state>
<state>
<code>BR-PA</code>
<name>Pará</name>
</state>
<state>
<code>BR-PB</code>
<name>Paraíba</name>
</state>
<state>
<code>BR-PR</code>
<name>Paraná</name>
</state>
<state>
<code>BR-PE</code>
<name>Pernambuco</name>
</state>
<state>
<code>BR-PI</code>
<name>Piauí</name>
</state>
<state>
<code>BR-RJ</code>
<name>Rio de Janeiro</name>
</state>
<state>
<code>BR-RN</code>
<name>Rio Grande do Norte</name>
</state>
<state>
<code>BR-RS</code>
<name>Rio Grande do Sul</name>
</state>
<state>
<code>BR-RO</code>
<name>Rondônia</name>
</state>
<state>
<code>BR-RR</code>
<name>Roraima</name>
</state>
<state>
<code>BR-SC</code>
<name>Santa Catarina</name>
</state>
<state>
<code>BR-SP</code>
<name>São Paulo</name>
</state>
<state>
<code>BR-SE</code>
<name>Sergipe</name>
</state>
<state>
<code>BR-TO</code>
<name>Tocantins</name>
</state>
</states>