About the Random Zip Code Generator
A hundred and one downtown ZIP codes are stored here, one per major city, spread across every region of the United States from 02108 in Boston to 99501 in Anchorage. The ZIP, the city and the two letter state code are stored as a single record, so the three parts always agree with one another. That is the part cheaper generators get wrong: a random five digit number matched to a random city produces data that fails the first validation rule it meets.
Three formats are available. The full record reads 78701 - Austin, TX and suits form testing where a postal lookup checks the city against the code. The five digit format strips everything but the number, which is what a database column usually wants. The ZIP plus four format appends a random four digit add-on segment, and that segment is invented rather than real, since add-on codes identify individual buildings and delivery routes.
Use the output to seed a test database, to check that an address form accepts a leading zero without eating it, or to fill a design mock-up with realistic looking data. These are real postal codes for real cities, so treat them as sample values rather than as anyone’s address. For a complete street line, the Random Address Generator assembles house number, street and city, and Billing Postal Code Generator covers checkout form testing.
How to use
- Choose the Format: full record, five digits only, or ZIP plus four.
- Set how many codes you need, up to a hundred at a time.
- Keep No repeats on when you are filling a column that has a unique constraint.
- Generate, then copy the block or download it as a text file for your fixtures.
Common questions
- Are these real ZIP codes?
- Yes, each five digit code is a genuine code for the city it is shown with. The four digit add-on in the plus four format is invented.
- Do leading zeros survive?
- They do. Codes such as 02108 keep the leading zero because the output is plain text, not a number.
- Is every state covered?
- The list covers cities across all regions of the country, one main code per city, rather than every ZIP in every state.
- Can I use these on a real form?
- They are meant for testing and mock-ups. Because the codes are real, do not submit them as if they were a genuine delivery address.