Key takeaways

  • Put municipality, two-letter province code, and postal code on the domestic last line
  • Use the alternating A1A 1A1 letter-number structure
  • Separate the two halves with a space, not a hyphen
  • Preserve French accents and long municipality names
Written by
Random Address Generator Editorial Team
Reviewed by
International Address Format Review Team
Latest substantive update
Reviewed postal-code spacing, province abbreviations, and last-line layout against Canada Post addressing guidelines.

The practical line structure

A common Canadian address is recipient, unit and street, municipality, then province and postal code. Domestic mail normally omits CANADA; international mail adds the country on its own last line.

Canada Post places municipality, province or territory abbreviation, and postal code together. That printed rule is useful for label screenshots, while the application should still store each component separately.

Format example
Amélie RoySuite 310, 88 King Street WestTORONTO ON M5V 3A8CANADA

Mapping Canadian form fields

A select may display Ontario while submitting ON. Test the visible label, submitted value, and backend enum independently. Do not use CA as a province: it is a country code in this context.

FieldExampleStorage advice
Address Line 188 King Street WestPreserve the entered spelling
Address Line 2Suite 310Optional; accept Unit, Apt, and Suite
City / MunicipalityTorontoUnicode string
ProvinceONTwo-letter province or territory code
Postal CodeM5V 3A8Uppercase with one internal space
CountryCAKeep separate from province

Postal-code validation and normalization

Canadian postal codes contain six alternating letters and numbers with a space after the third character. A form can accept lowercase or compact input and normalize it on blur, but its canonical output should not insert a hyphen.

A pattern match proves shape only. Use a dependable postal data source if the product must establish that the municipality and code agree.

function normalizeCanadianPostalCode(value) {
  const compact = value.trim().toUpperCase().replace(/\s+/g, '');
  return compact.length === 6 ? `${compact.slice(0, 3)} ${compact.slice(3)}` : value.trim();
}

Bilingual and Unicode data is not optional

Names, streets, and municipalities can contain accented characters. An ASCII-only sanitizer damages the record before postal validation even begins.

Regression fixtures should include accents, hyphenated names, a long municipality, and an empty second line. Export the fixture to CSV and import it again to confirm that encoding survives.

  • Use UTF-8 for import and export
  • Never silently strip accents
  • Test labels separately from submitted codes
  • Exercise long locality wrapping on mobile

The boundary between format and delivery checks

Synthetic records are useful for field length, province selects, postal-code hints, and export formats. They do not establish that a street and building combination exists. A shipping workflow needs a separate authorized lookup or user confirmation.

A review from user input to printed label

Begin with one record that includes an accented name, a Suite, and a lowercase compact postal code. Preserve the entered value, then create an uppercase normalized value with one internal space when the shopper leaves the field. Make both values observable in test diagnostics so a server encoding fault cannot hide behind a browser that renders the initial text correctly.

Next, change the province and confirm that municipality suggestions and postal-code validation reset together. A stale suggestion from the previous province is more dangerous than an obvious empty field because it looks credible. Capture the outgoing request and verify that the select submits the province code rather than its localized label.

Finally render domestic and international labels. The domestic version should not add CANADA; the international version places the country on a final line. Inspect the actual PDF or rasterized print output. An HTML preview can look correct while a print font drops an accent, replaces a glyph, or clips the municipality line.

  • Use Montréal and accented names for Unicode coverage
  • Trace both raw input and normalized postal code
  • Do not retain Canadian validation after a country change
  • Compare domestic and international country-line output

Frequently asked questions

Does a Canadian postal code use a space or hyphen?

Use one space in the canonical display, such as M5V 3A8. Do not use a hyphen.

Should I store Ontario or ON?

Follow your API contract. A common pattern displays Ontario, submits ON, and maintains an explicit enum mapping on the server.

Is a regex-valid postal code ready for shipping?

No. A pattern validates format only. Shipping still requires the complete address and an appropriate delivery check.

Sources and further reading

  1. Canada Post: Important addressing information
  2. MDN: HTML autocomplete address fields