Canada - Formatting standards & code snippets

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

  • Alpha-2: CA
  • Alpha-3: CAN
  • Numeric: 124
  • Java Locale Code: en_CA and fr_CA
  • .Net CultureInfo Code: en-CA and fr-CA
  • PHP Locale Code: en_CA and fr_CA

What is the official language in Canada?

  • English AND French, although English is more common

What is the date format in Canada?

The date format in Canada is big-endian:

  • Format: yyyy-MM-dd
    Ex: 2014-12-31 for December 3rd 2014
Formatting a date in Java:
Locale locale = new Locale("en", "CA"); // or "fr"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", locale);
sdf.format(new Date());
Formatting a date in C#:
CultureInfo ci = CultureInfo.GetCultureInfo("en-CA"); // or "fr-CA"
DateTime.Now.ToString("yyyy-MM-dd", ci);
Formatting a date in JavaScript:
let date = new Date();
date.toLocaleDateString('en-CA'); // Will also work with fr-CA
Formatting a date in PHP:
date("Y-m-d");

What is the time format in Canada?

The time format in Canada is 24-hour notation in most cases.

  • Format: HH:mm[:ss]
    Ex: 09:00 for 09:00AM, and 21:00 for 09:00PM
Formatting time in Java:
Locale locale = new Locale("en", "CA"); // or fr
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", locale);
sdf.format(new Date());
Formatting time in C#:
CultureInfo ci = CultureInfo.GetCultureInfo("en-CA"); // or "fr-CA"
DateTime.Now.ToString("HH:mm:ss", ci);
Formatting time in JavaScript:
let date = new Date();
date.toLocaleTimeString('en-CA', {hour12: false}); // or fr
Formatting time in PHP:
date("H:i:s");

What is the numeric format in Canada?

  • Format - English: 999,999,999.99
    • Group Size: 3
    • Grouping Character: , (comma)
    • Decimal Character: . (dot)
  • Format - French: 999 999 999,99
    • Group Size: 3
    • Grouping Character: space
    • Decimal Character: , (comma)
Formatting numbers in Java:
Locale locale = new Locale("en", "CA"); // or "fr"
NumberFormat numberFormat = NumberFormat.getNumberInstance(locale);
numberFormat.format(999999999.99d);
Formatting numbers in C#:
double d = 999999999.99d;
d.ToString("n", CultureInfo.GetCultureInfo("en-CA"))); // or "fr-CA"
Formatting numbers in JavaScript:
let number = 999999999.99;
number.toLocaleString('en-CA'); // or 'fr-CA'
Formatting numbers in PHP:
$fmt = new NumberFormatter($locale = 'en_CA', NumberFormatter::DECIMAL); // or 'fr_CA'
$fmt->format(999999999.99);

What is the currency format in Canada?

  • Format - English: $999,999,999.99
    • Group Size: 3
    • Grouping Character: , (comma)
    • Decimal Character: . (dot)
    • Currency Symbol: $
    • Currency Symbol Position: Before number
    • Currency Name: Canadian Dollar (CAD)
  • Format - French: 999 999 999,99 $
    • Group Size: 3
    • Grouping Character: space
    • Decimal Character: , (comma)
    • Currency Symbol: $
    • Currency Symbol Position: After number
    • Currency Name: Canadian Dollar (CAD)
Formatting currency in Java:
Locale locale = new Locale("en", "CA"); // or "fr"
NumberFormat numberFormat = NumberFormat.getCurrencyInstance(locale);
numberFormat.format(999999999.99d);
Formatting currency in C#:
double d = 999999999.99d;
d.ToString("c", CultureInfo.GetCultureInfo("en-CA"))); // or "fr-CA"
Formatting currency in JavaScript:
let number = 999999999.99;
number.toLocaleString('en-CA', {currency: 'CAD', style: 'currency'}); // or 'fr-CA'
Formatting currency in PHP:
$fmt = new NumberFormatter($locale = 'en_CA', NumberFormatter::CURRENCY); // or 'fr_CA'
$fmt->format(999999999.99);

What is the postal address format in Canada?

  • JOHN DOE
    MY COMPANY
    1234 MAISONNEUVE W. SUITE 123
    MONTREAL QC H8R 1W2
    CANADA
  • JOHN DOE: Name of the person
  • MY COMPANY: Name of the company if there is one
  • 1234: Civic number
  • STREET: Street name
  • W: Direction of street if there is one. E for east, W for west, N for north, S for south
  • SUITE 123: Suite or appartment number if there is one
  • MONTREAL: City name
  • QC: Province or territory code. 2 letters
  • H8R 1W2: Postal Code
  • CANADA: Name of country.

What are the unit of measurement used in Canada?

Canada uses the metric system since 1970.

Units for length

Unit Abbreviation Equivalence
Nanometre nm 10-9m
Micrometre µm 10-6m
Millimetre mm 10-3m
Centimetre cm 10-2m
Metre m Reference Unit
Kilometre km 103m

Units for area

Unit Abbreviation Equivalence
Square Metre Reference Unit
Hectare ha 10,000m²
Square Kilometre km² 100ha

Units for volume (dry goods)

Unit Abbreviation Equivalence
Cubic Centimetre cm³ 1mL or 10-6m3
Cubic Metre Reference Unit
Cubic Kilometre km³ 109

Units for volume (liquids)

Unit Abbreviation Equivalence
Millilitre mL 0.001L
Centilitre cL 0.01L
Litre L Reference Unit
Hectoliter hL 100L

Units for weight

Unit Abbreviation Equivalence
Microgram mcg 10-9kg
Gram g 0.001kg
Kilogram kg Reference Unit
Ton (Tonne) 1000kg

Other units (temperature, force, power, energy)

Measurement Unit Abbreviation Definition
Force Newton N Force to give mass of one kilogram an acceleration of one meter per second squared
Power Watt W One joule per second
Energy Joule J Work done by one newton to move one meter in direction of force
Temperature Celcius °C 274.15K
Absolute Temperature Kelvin K -272.15°C
Speed Kilometres per hour km/h or kph

Download list of provinces for Canada in CSV, JSON, HTML, SQL and XML


List of provinces: HTML - Select Control

----------------------------
 Alpha-2 code + Alpha-2 code
----------------------------
<select>
	<option value="AB">AB</option>
	<option value="BC">BC</option>
	<option value="MB">MB</option>
	<option value="NB">NB</option>
	<option value="NL">NL</option>
	<option value="NS">NS</option>
	<option value="NT">NT</option>
	<option value="NU">NU</option>
	<option value="ON">ON</option>
	<option value="PE">PE</option>
	<option value="QC">QC</option>
	<option value="SK">SK</option>
	<option value="YT">YT</option>
</select>

------------------------------
 Alpha-2 code + name - English
------------------------------
<select>
	<option value="AB">Alberta</option>
	<option value="BC">British Columbia</option>
	<option value="MB">Manitoba</option>
	<option value="NB">New Brunswick</option>
	<option value="NL">Newfoundland and Labrador</option>
	<option value="NS">Nova Scotia</option>
	<option value="NT">Northwest Territories</option>
	<option value="NU">Nunavut</option>
	<option value="ON">Ontario</option>
	<option value="PE">Prince Edward Island</option>
	<option value="QC">Quebec</option>
	<option value="SK">Saskatchewan</option>
	<option value="YT">Yukon</option>
</select>

------------------------------
 Alpha-2 code + name - French
------------------------------
<select>
	<option value="AB">Alberta</option>
	<option value="BC">Colombie-Britannique</option>
	<option value="PE">Île-du-Price-Édouard</option>
	<option value="MB">Manitoba</option>
	<option value="NB">Nouveau-Brunswick</option>
	<option value="NS">Nouvelle-Écosse</option>
	<option value="NU">Nunavut</option>
	<option value="ON">Ontario</option>
	<option value="QC">Québec</option>
	<option value="SK">Saskatchewan</option>
	<option value="NL">Terre-Neuve-et-Labrador</option>
	<option value="NT">Territoires du Nord-Ouest</option>
	<option value="YT">Territoire du Yukon</option>
</select>

---------------------------------
 ISO_3166-2 code + name - English
---------------------------------
<select>
	<option value="CA-AB">Alberta</option>
	<option value="CA-BC">British Columbia</option>
	<option value="CA-MB">Manitoba</option>
	<option value="CA-NB">New Brunswick</option>
	<option value="CA-NL">Newfoundland and Labrador</option>
	<option value="CA-NS">Nova Scotia</option>
	<option value="CA-NT">Northwest Territories</option>
	<option value="CA-NU">Nunavut</option>
	<option value="CA-ON">Ontario</option>
	<option value="CA-PE">Prince Edward Island</option>
	<option value="CA-QC">Quebec</option>
	<option value="CA-SK">Saskatchewan</option>
	<option value="CA-YT">Yukon</option>
</select>

---------------------------------
 ISO_3166-2 code + name - French
---------------------------------
<select>
	<option value="CA-AB">Alberta</option>
	<option value="CA-BC">Colombie-Britannique</option>
	<option value="CA-PE">Île-du-Price-Édouard</option>
	<option value="CA-MB">Manitoba</option>
	<option value="CA-NB">Nouveau-Brunswick</option>
	<option value="CA-NS">Nouvelle-Écosse</option>
	<option value="CA-NU">Nunavut</option>
	<option value="CA-ON">Ontario</option>
	<option value="CA-QC">Québec</option>
	<option value="CA-SK">Saskatchewan</option>
	<option value="CA-NL">Terre-Neuve-et-Labrador</option>
	<option value="CA-NT">Territoires du Nord-Ouest</option>
	<option value="CA-YT">Territoire du Yukon</option>
</select>

List of provinces: CSV

// Provinces/Territories - English //
CA-AB,"Alberta"
CA-BC,"British Columbia"
CA-MB,"Manitoba"
CA-NB,"New Brunswick"
CA-NL,"Newfoundland and Labrador"
CA-NS,"Nova Scotia"
CA-NT,"Northwest Territories"
CA-NU,"Nunavut"
CA-ON,"Ontario"
CA-PE,"Prince Edward Island"
CA-QC,"Quebec"
CA-SK,"Saskatchewan"
CA-YT,"Yukon"

// Provinces/Territories - French //
CA-AB,"Alberta"
CA-BC,"Colombie-Britannique"
CA-PE,"Île-du-Price-Édouard"
CA-MB,"Manitoba"
CA-NB,"Nouveau-Brunswick"
CA-NE,"Nouvelle-Écosse"
CA-NU,"Nunavut"
CA-ON,"Ontario"
CA-QC,"Québec"
CA-SK,"Saskatchewan"
CA-NL,"Terre-Neuve-et-Labrador"
CA-NT,"Territoires du Nord-Ouest"
CA-YT,"Territoire du Yukon"

List of provinces: JSON

-------------------------------
 Alpha-2 code + Name - English
-------------------------------
[
	{code: "AB", name: "Alberta"},
	{code: "BC", name: "British Columbia"},
	{code: "MB", name: "Manitoba"},
	{code: "NB", name: "New Brunswick"},
	{code: "NL", name: "Newfoundland and Labrador"},
	{code: "NS", name: "Nova Scotia"},
	{code: "NT", name: "Northwest Territories"},
	{code: "NU", name: "Nunavut"},
	{code: "ON", name: "Ontario"},
	{code: "PE", name: "Prince Edward Island"},
	{code: "QC", name: "Quebec"},
	{code: "SK", name: "Saskatchewan"},
	{code: "YT", name: "Yukon"}
]

-------------------------------
 Alpha-2 code + Name - French
-------------------------------
[
	{code: "AB", name: "Alberta"},
	{code: "BC", name: "Colombie-Britannique"},
	{code: "MB", name: "Manitoba"},
	{code: "NB", name: "Nouveau-Brunswick"},
	{code: "NL", name: "Terre-Neuve-et-Labrador"},
	{code: "NS", name: "Nouvelle-Écosse"},
	{code: "NT", name: "Territoires du Nord-Ouest"},
	{code: "NU", name: "Nunavut"},
	{code: "ON", name: "Ontario"},
	{code: "PE", name: "Île-du-Price-Édouard"},
	{code: "QC", name: "Québec"},
	{code: "SK", name: "Saskatchewan"},
	{code: "YT", name: "Territoire du Yukon"}
]

----------------------------------
 ISO-3166-2 code + Name - English
----------------------------------
[
	{code: "CA-AB", name: "Alberta"},
	{code: "CA-BC", name: "British Columbia"},
	{code: "CA-MB", name: "Manitoba"},
	{code: "CA-NB", name: "New Brunswick"},
	{code: "CA-NL", name: "Newfoundland and Labrador"},
	{code: "CA-NS", name: "Nova Scotia"},
	{code: "CA-NT", name: "Northwest Territories"},
	{code: "CA-NU", name: "Nunavut"},
	{code: "CA-ON", name: "Ontario"},
	{code: "CA-PE", name: "Prince Edward Island"},
	{code: "CA-QC", name: "Quebec"},
	{code: "CA-SK", name: "Saskatchewan"},
	{code: "CA-YT", name: "Yukon"}
]

----------------------------------
 ISO-3166-2 code + Name - French
----------------------------------
[
	{code: "CA-AB", name: "Alberta"},
	{code: "CA-BC", name: "Colombie-Britannique"},
	{code: "CA-MB", name: "Manitoba"},
	{code: "CA-NB", name: "Nouveau-Brunswick"},
	{code: "CA-NL", name: "Terre-Neuve-et-Labrador"},
	{code: "CA-NS", name: "Nouvelle-Écosse"},
	{code: "CA-NT", name: "Territoires du Nord-Ouest"},
	{code: "CA-NU", name: "Nunavut"},
	{code: "CA-ON", name: "Ontario"},
	{code: "CA-PE", name: "Île-du-Price-Édouard"},
	{code: "CA-QC", name: "Québec"},
	{code: "CA-SK", name: "Saskatchewan"},
	{code: "CA-YT", name: "Territoire du Yukon"}
]

List of provinces: SQL

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

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

---------------------
 Alpha-2 code + name
---------------------

INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'AB', 'Alberta', 'Alberta');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'BC', 'British Columbia', 'Colombie-Britannique');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'MB', 'Manitoba', 'Manitoba');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'NB', 'New Brunswick', 'Nouveau-Brunswick');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'NL', 'Newfoundland and Labrador', 'Terre-Neuve-et-Labrador');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'NS', 'Nova Scotia', 'Nouvelle-Écosse');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'NT', 'Northwest Territories', 'Territoires du Nord-Ouest');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'NU', 'Nunavut', 'Nunavut');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'ON', 'Ontario', 'Ontario');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'PE', 'Prince Edward Island', 'Île-du-Price-Édouard');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'QC', 'Quebec', 'Québec');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'SK', 'Saskatchewan', 'Saskatchewan');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'YT', 'Yukon', 'Territoire du Yukon');

------------------------
 ISO-3166-2 code + name
------------------------

INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-AB', 'Alberta', 'Alberta');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-BC', 'British Columbia', 'Colombie-Britannique');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-MB', 'Manitoba', 'Manitoba');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-NB', 'New Brunswick', 'Nouveau-Brunswick');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-NL', 'Newfoundland and Labrador', 'Terre-Neuve-et-Labrador');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-NS', 'Nova Scotia', 'Nouvelle-Écosse');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-NT', 'Northwest Territories', 'Territoires du Nord-Ouest');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-NU', 'Nunavut', 'Nunavut');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-ON', 'Ontario', 'Ontario');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-PE', 'Prince Edward Island', 'Île-du-Price-Édouard');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-QC', 'Quebec', 'Québec');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-SK', 'Saskatchewan', 'Saskatchewan');
INSERT INTO province (id, code, name_en, name_fr) VALUES (null, 'CA-YT', 'Yukon', 'Territoire du Yukon');

List of provinces: XML

<!-- Alpha-2 code + name - English -->
<?xml version="1.0" encoding="UTF-8"?>
<provinces>
	<province>
		<code>AB</code>
		<name>Alberta</name>
	</province>
	<province>
		<code>BC</code>
		<name>British Columbia</name>
	</province>
	<province>
		<code>MB</code>
		<name>Manitoba</name>
	</province>
	<province>
		<code>NB</code>
		<name>New Brunswick</name>
	</province>
	<province>
		<code>NL</code>
		<name>Newfoundland and Labrador</name>
	</province>
	<province>
		<code>NS</code>
		<name>Nova Scotia</name>
	</province>
	<province>
		<code>NT</code>
		<name>Northwest Territories</name>
	</province>
	<province>
		<code>NU</code>
		<name>Nunavut</name>
	</province>
	<province>
		<code>ON</code>
		<name>Ontario</name>
	</province>
	<province>
		<code>PE</code>
		<name>Prince Edward Island</name>
	</province>
	<province>
		<code>QC</code>
		<name>Quebec</name>
	</province>
	<province>
		<code>SK</code>
		<name>Saskatchewan</name>
	</province>
	<province>
		<code>YT</code>
		<name>Yukon</name>
	</province>
</provinces>

<!-- Alpha-2 code + name - French -->
<?xml version="1.0" encoding="UTF-8"?>
<provinces>
	<province>
		<code>AB</code>
		<name>Alberta</name>
	</province>
	<province>
		<code>BC</code>
		<name>Colombie-Britannique</name>
	</province>
	<province>
		<code>MB</code>
		<name>Manitoba</name>
	</province>
	<province>
		<code>NB</code>
		<name>Nouveau-Brunswick</name>
	</province>
	<province>
		<code>NL</code>
		<name>Terre-Neuve-et-Labrador</name>
	</province>
	<province>
		<code>NS</code>
		<name>Nouvelle-Écosse</name>
	</province>
	<province>
		<code>NT</code>
		<name>Territoires du Nord-Ouest</name>
	</province>
	<province>
		<code>NU</code>
		<name>Nunavut</name>
	</province>
	<province>
		<code>ON</code>
		<name>Ontario</name>
	</province>
	<province>
		<code>PE</code>
		<name>Île-du-Price-Édouard</name>
	</province>
	<province>
		<code>QC</code>
		<name>Québec</name>
	</province>
	<province>
		<code>SK</code>
		<name>Saskatchewan</name>
	</province>
	<province>
		<code>YT</code>
		<name>Territoire du Yukon</name>
	</province>
</provinces>

<!-- ISO 3166-2 code + name - English -->
<?xml version="1.0" encoding="UTF-8"?>
<provinces>
	<province>
		<code>CA-AB</code>
		<name>Alberta</name>
	</province>
	<province>
		<code>CA-BC</code>
		<name>British Columbia</name>
	</province>
	<province>
		<code>CA-MB</code>
		<name>Manitoba</name>
	</province>
	<province>
		<code>CA-NB</code>
		<name>New Brunswick</name>
	</province>
	<province>
		<code>CA-NL</code>
		<name>Newfoundland and Labrador</name>
	</province>
	<province>
		<code>CA-NS</code>
		<name>Nova Scotia</name>
	</province>
	<province>
		<code>CA-NT</code>
		<name>Northwest Territories</name>
	</province>
	<province>
		<code>CA-NU</code>
		<name>Nunavut</name>
	</province>
	<province>
		<code>CA-ON</code>
		<name>Ontario</name>
	</province>
	<province>
		<code>CA-PE</code>
		<name>Prince Edward Island</name>
	</province>
	<province>
		<code>CA-QC</code>
		<name>Quebec</name>
	</province>
	<province>
		<code>CA-SK</code>
		<name>Saskatchewan</name>
	</province>
	<province>
		<code>CA-YT</code>
		<name>Yukon</name>
	</province>
</provinces>

<!-- ISO 3166-2 code + name - French -->
<?xml version="1.0" encoding="UTF-8"?>
<provinces>
	<province>
		<code>CA-AB</code>
		<name>Alberta</name>
	</province>
	<province>
		<code>CA-BC</code>
		<name>Colombie-Britannique</name>
	</province>
	<province>
		<code>CA-MB</code>
		<name>Manitoba</name>
	</province>
	<province>
		<code>CA-NB</code>
		<name>Nouveau-Brunswick</name>
	</province>
	<province>
		<code>CA-NL</code>
		<name>Terre-Neuve-et-Labrador</name>
	</province>
	<province>
		<code>CA-NS</code>
		<name>Nouvelle-Écosse</name>
	</province>
	<province>
		<code>CA-NT</code>
		<name>Territoires du Nord-Ouest</name>
	</province>
	<province>
		<code>CA-NU</code>
		<name>Nunavut</name>
	</province>
	<province>
		<code>CA-ON</code>
		<name>Ontario</name>
	</province>
	<province>
		<code>CA-PE</code>
		<name>Île-du-Price-Édouard</name>
	</province>
	<province>
		<code>CA-QC</code>
		<name>Québec</name>
	</province>
	<province>
		<code>CA-SK</code>
		<name>Saskatchewan</name>
	</province>
	<province>
		<code>CA-YT</code>
		<name>Territoire du Yukon</name>
	</province>
</provinces>