Country referenceCanada country page

Canada Postal Code Format

A country-level reference for how postal and ZIP codes are structured in Canada.

Postal format
CA : A0A 0A0
Library format pattern
^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$
Format test inputs (not verified assigned codes)
A4B5X5, A4B5A5

These strings come from software tests, not a directory of assigned postal codes. They are checked using the library's country-specific separator rules before display. A format match does not establish assignment or deliverability.

Check a postal code format

Enter a code to compare its syntax with the pattern above. The checker ignores letter case and trims outer whitespace. ASCII spaces and hyphens are removed before matching. Other internal whitespace is preserved. These are the separator rules declared by this library version.

A format match does not confirm assignment, an address, or delivery availability.

Reading M4B 1G5 on a Canadian address label

Canada Post uses M4B 1G5 in its addressing guide. The first group, M4B, is the Forward Sortation Area. The second, 1G5, is the Local Delivery Unit. If an export keeps only M4B, it has lost three characters needed for the full postal code.

Compare M4B 1G5 with M4B 1G in the checker above. The complete example matches the six-character pattern. The shortened version is missing its final digit. Ask for the original address before filling that gap: several digits could fit the pattern.

On a mailing label, use uppercase letters and one space between the groups. To confirm the right code for a shipment, check the recipient’s full address with Canada Post. Canada Post postal code structure · Addressing guide and worked postal code diagram

Source and limits

The format description, pattern, and test inputs are imported from postal-codes-js 2.5.2 (Apache-2.0). Inputs originate in the library's TestData.Valid fixtures. Their label means they were supplied for software testing; it does not establish that a postal service assigned them.

This is a versioned software reference, not a live postal directory. We have not independently verified every country's current rules. For an actual shipment, check the full address and postcode with the destination postal operator or carrier.