Canada Postal Code Generator

Generate postal codes on their own, valid for the province or territory you pick, in bulk and reproducibly.

Postal codes on their own

The main generator produces whole addresses. This produces postal codes only — for when you need to fill a column, exercise a validator, or seed a lookup table without carrying a name and a street along with it.

Every code is valid for the region it is generated in: the first letter is one Canada Post assigns to that province or territory. Filter by region, generate in bulk, and export.

What "valid" means here, and what it does not

These codes are structurally correct and regionally consistent. They are not guaranteed to be forward sortation areas that exist. This site holds no Canada Post address data — it is licensed commercially and cannot be redistributed — so nothing here can confirm a code is in service.

For testing a validator, a form or a database column, that distinction rarely matters: you want well-formed input that your code should accept. For anything that needs a real postal code, it matters entirely.

The rules the generator follows

Reproducible sets

Supply a seed and the same set comes back every time. That is what makes a generated list safe to commit to a test suite: the fixture does not drift underneath the assertions written against it.

The seed is always shown, including when you did not supply one — an unseeded run mints a seed and reports it, so an exploratory batch can be pinned afterwards rather than regenerated and lost.

Exporting

CSV export quotes the postal code column as text. This is not decoration: a spreadsheet opening an unquoted column of postal codes may reinterpret values it considers numeric-ish, and a code that arrives as something other than the string you exported is a silent data-corruption bug.

Questions

Are these real postal codes?

They are structurally valid and correct for their region, but the forward sortation area is generated and may not be one Canada Post has assigned. Nothing here checks a code against Canada Post data, because this site holds none.

Can I generate codes for one province only?

Yes. Choose a province or territory and every code returned starts with a letter valid for it. Note that Northwest Territories and Nunavut both use X, so codes for those two are indistinguishable by design.

How do I get the same codes again tomorrow?

Supply the same seed and the same options. Within a data version the output is byte-identical, permanently.

Why does my spreadsheet mangle the postal codes?

Because it is guessing at the column type. The CSV export here quotes postal codes as text to prevent it. If you are building your own export, do the same.

Related

Everything this site generates is synthetic, produced for development, QA, testing, demos and staging. The records do not represent real people, and the addresses are not verified deliverable addresses.