Long-form reference on how Canadian addresses and postal codes actually work — written for developers, testers and anyone who has had a form reject a valid address.
How to Write a Canadian Address (Canada Post Format, With Examples) — Canada Post's rules for writing an address: line order, uppercase, two spaces before the postal code, where the unit number goes, and the abbreviations to use. With worked examples for apartments, PO boxes and rural routes.
Generating Test Addresses for Canada: A Guide for Developers and QA — How to produce Canadian test addresses that are realistic enough to exercise your code and safe enough to commit. Covers seeded generation, the edge cases worth testing, and why real customer addresses do not belong in a test database.
Postal Code vs ZIP Code: What's the Difference? — A ZIP code is the US system — five digits. A Canadian postal code is six alternating letters and digits. They are not interchangeable. Here is what differs, why forms reject the wrong one, and what to enter where.
Validating Canadian Postal Codes: Regex, Edge Cases and Common Mistakes — The obvious Canadian postal code regex is wrong. It permits letters that never occur and rejects real codes like M4W and H2Z. Here is the correct pattern, the test cases that catch the usual failures, and what validation can and cannot prove.