Random ZIP Code Generator
Generate random US ZIP codes for testing forms and validators, in five-digit or ZIP+4 format. Leading zeros are preserved, which is where most ZIP bugs come from.
ZIP codes
Press Generate to get a result.
About the Random ZIP Code Generator
The leading zero problem
ZIP codes are strings that happen to look like numbers, and treating them as numbers is one of the most common data bugs there is. Massachusetts ZIPs start with 0, so 02134 becomes 2134 the moment a spreadsheet or a database column decides it is an integer. Whole mailing lists have been ruined this way.
This generator produces leading zeros on purpose, at the rate they occur, so your test data actually exercises the case instead of hiding it.
ZIP+4
The four-digit extension narrows a ZIP to a block, a building or sometimes a single high-volume recipient. Forms that accept it need to handle the hyphen, the extra length, and the fact that it is optional — three more things worth testing than the five-digit case alone.