What breaks

ZIP code validation: why valid codes fail

A buyer in Manchester types a postal code from her letter and the checkout calls it invalid. The rule was written for five digits, and her code has letters and a space in it.

5 visitors try to .
First test free with an accountRun it from your coding agent

Why does ZIP code validation reject valid postal codes?

Most ZIP code rules expect five digits, or five digits and four more after a dash. A UK postcode has letters and a space, a Canadian one alternates letters and digits, and a US ZIP that starts with 0 loses that zero when a field stores it as a number. Make the rule depend on the country the buyer picked, and keep the code as text. A simulated test enters one address per country and shows which one the form refuses.

What this looks like in a report

Who
Bronwen, sending a ceramic mug to her sister in Bristol
How they arrived
Opened a pottery shop's link from a social post
Where they stopped
Address form, at the postal code box

“I copied the postcode from my sister's letter, which has a letter and a space in it. The box said ZIP code invalid. I tried just the numbers, then the first half. The form never once asked where she lives.”

The fix. Show the postal code rule for the country the buyer picked, and accept letters and a space for countries that use them. Store the code as text so a leading zero stays, then test one address from each country you ship to.

An illustration. Run a test to see your own.See a real sample report

The buyer's code is valid, and the field counts it as wrong

A buyer ships a gift to a flat in Manchester and types the postcode exactly as it is printed on the letter. The field wants five digits, so the red message says the ZIP code is invalid. The buyer tries a shorter version, then a longer one, and nothing passes. Another buyer in Massachusetts types 02134, and the form stores it as the number 2134, drops the leading zero and then counts four digits. Neither buyer made a mistake. The rule was written for one country, and the form never asked which country it was checking.

  • Pick a country outside the US. Does the postal code field still ask for five digits?
  • Type a US ZIP that starts with 0. Is the zero still there after you press Continue?
  • Type a UK postcode with its space. Does the field accept it without changes?
  • Read the error text. Does it name the country rule, or only say invalid?

Each country writes its code differently

A US ZIP code is five digits, and sometimes five digits, a dash and four more. A UK postcode mixes letters and digits with a space in the middle, so a rule written for digits cannot read it. Canadian postal codes alternate letters and digits, and German codes are five digits that can begin with zero. A form built for one country reads every other country as an error, and a buyer who sees the error cannot tell that the rule, not their address, is at fault.

The same field can also mislead on the country the buyer chose. Some checkouts keep a ZIP label after the buyer selects another country, because the label was set once and never changed. The buyer then types a postal code under a label that says ZIP, while the rule that runs is still the one for the first country. Check the label and the rule for each country on your list, not only the default one.

The leading zero that disappears

A ZIP code is a label, not a quantity, so it should be stored as text. A form that converts the value to a number keeps 2134 and drops the zero in 02134, and then the rule counts four digits and refuses it. Spreadsheets can drop the zero as well when they open an order export, and the wrong code then reaches the next system that reads the file.

A simulated run shows the effect. Enter a US address with a ZIP that starts with 0, then look at the screenshot at the step after Continue to see whether the zero survived. If it is missing on the review screen, the change happened in the form or the code behind it, not in the buyer's address. Compare the value on screen with the value in your order record to find which layer changed it.

Choose the country first, then the code

Put the country field before the postal code field, and let the choice decide the rule. A country with a known format gets its own check. A country without postal codes hides the field and removes it from the required list. A country you do not ship to should stop the checkout with a message that names the country, instead of an invalid code message that makes the buyer retype the postal code.

Test one address from each country you ship to, plus one US address with a ZIP that starts with 0. A test cannot tell you which postal codes your carrier delivers to, or whether a code exists, so read those rules from the carrier. What the test does show is the step where an address was refused and the screen the refusal appeared on.

What you get with Mimiq

  1. 01

    Run it by hand, or on every pull request

    Paste a link and a task in the app and watch the visitors work. Or run them on every preview deploy: the GitHub Action comments on the pull request, any other CI can call the MCP endpoint, and your coding agent can run it too.

  2. 02

    Bugs and usability problems in one report

    The browser records errors and failed or slow requests on the step they happened. The visitors say where the wording or the steps confused them, and where they left.

  3. 03

    Visitors that behave like your audience

    Each visitor is a different profile with a reason to be there, matched to who the page is for, described by you, or built from your own customers.

  4. 04

    A prompt to fix each problem

    Every problem comes with a fix to paste into Cursor, Claude Code, Lovable or any coding agent, and one prompt hands over the top problems at once. Then send the same visitors through again.

  5. 05

    Follow every visitor

    See each visitor's whole path, step by step with screenshots, and what it was thinking at every step. Ask any visitor a question.

The browser records relevant JavaScript errors and failed or slow app requests encountered during the run, attached to the step where they occurred. The visitors are simulated: they find problems, they do not predict how many real people will convert.

A new shipping country can bring the rejection back

Adding a country to your store, changing the shipping list or moving to a new checkout can bring back a rule you already fixed. Rerun one address per country after each change, and compare where each one stopped. A checkout behind a login can be tested with a test account from paid credits.

Starter

Try it on one launch

$9 once
120 credits, never expire

24 visitors, about 4 tests of 5

  • Visitors on your landing page, signup and checkout
  • Where they left and why, with a fix to copy for each problem
  • Run it in the app or on every pull request
  • Ask any visitor a question, included
  • Test accounts and protected previews
Buy 120 credits

Builder

Test every build

$19 a month
500 credits every month

100 visitors, about 20 tests of 5

  • Everything in Starter
  • Credits refill each month, and what is left rolls over once
  • Cancel anytime
Choose Builder

Pro

Test every release, as a team

$49 a month
1,500 credits every month

300 visitors, about 60 tests of 5

  • Everything in Starter
  • Credits refill each month, and what is left rolls over once
  • Cancel anytime
Choose Pro

Scale

Test at scale, every day

$149 a month
6,000 credits every month

1,200 visitors, about 240 tests of 5

  • Everything in Starter
  • Credits refill each month, and what is left rolls over once
  • Priority support
  • Cancel anytime
Choose Scale
$0for your first test, with a free account (Google or email, no card). It includes 50 credits, enough for 10 visitors. After that a visitor uses 5 credits, and packs start at $9 for 120 credits.
See a sample report

Questions

Should I drop the ZIP code field for countries that do not use one?

Yes, for countries where the buyer has no postal code or the carrier does not need one. Hide the field only after the country is chosen, and keep it required for countries that use it. Your shipping settings decide which countries those are, so read them before you change the form.

Does a simulated test check whether a postal code is real?

No. It enters the code you give it and reports whether the form accepted it and where it stopped. It cannot tell you whether the postal code exists or whether a carrier delivers there.

Why does a US ZIP with a leading zero fail only sometimes?

It fails when the value passes through a number field, a spreadsheet or a system that stores codes as integers. Some paths keep the text, so the same code works on one page and fails on another. Compare the value the form shows with the value your order export records.

Should the postal code be required?

Require it only where the buyer must give one for the parcel to arrive. A required field the buyer cannot fill stops the checkout completely. Make it optional with a clear note for countries that do not use one.

Can one rule cover every country?

Not well. A single pattern either rejects real codes or accepts wrong ones. Use a rule for each country you ship to, or accept any code within a sensible length range and let the carrier decide whether it is valid.

Keep reading

Send visitors and see what breaks first.

Your first test is free: sign in with Google or email and it starts right away. Last checked 2026-12-03.

5 visitors try to .