A ZIP code is a five-digit numeric code used by the United States Postal Service in sorting mail. The first digit indicates a group of states; the second and third, a region of a state or a large city; and the fourth and fifth, a small town, a delivery area in a larger town or city, a particular postal facility, or a particular large mail recipient. Extensions of the ZIP code include the nine-digit ZIP+4 code and the 11-digit ABC (Advanced Bar Coding) code.
ZIP codes were introduced by the Postal Service in 1963, with a massive advertising campaign feature "Mr. Zip," which encouraged Americans to use the numbers. "ZIP" is an acronym for "Zone Improvement Plan."
ZIP codes are encoded into barcodes, using a redundant binary code with tall lines to represent the bit "1" and short lines to represent the bit "0," and printed on mail. A "1" (tall line) starts and ends the ZIP code, and immediately before the final "1" comes a checksum digit which, when added to all of the digits of the ZIP code, adds to a multiple of 10. The code scheme is chosen so that each digit's binary equivalent has exactly two "1"'s. Digits are encoded as follows:
|Digit||Binary encoding||Digit||Binary encoding|