All Functions

upc - Universal Product Code

The Universal Product Code (UPC) is a barcode symbology that is widely used in North America, the United Kingdom, Australia, New Zealand and in other countries for tracking trade items in stores.

Source: wiki/Universal_Product_Code

This function allows to generate random UPC codes.

The UPC code is actually a GTIN-12 family code as defined by the GS1.


upc ( ) Returns a random UPC number
upc ( $prefill ) Returns a random UPC number with a prefix $prefill


$prefill The optional parameter to indicate a specific range


Random UPC numbers

upc() - 7437128715432
Returns random UPC numbers

upc(1337) - 1337116512974
Returns a random UPC number with a pre-filled prefix value of 1337.

See also

gtin - Global Trade Item Number ean - EAN International ucc - Uniform Code Council cip - Catalogue Item Publication jan - Japanese Article Number sscc - Serial Shipping Container Code gln - Global Location Number