1D Free plan

UPC-A Barcode Generator API

North American retail standard

Sample UPC-A barcode

0012345678905 012345678905

Generated live by the BarGen API from 01234567890

UPC-A is the standard 12-digit retail barcode used across North America, standardized by GS1 as part of the same numbering system as EAN-13. It consists of a system digit, a 5-digit manufacturer code, a 5-digit product code, and a check digit, and is printed on nearly every packaged consumer product sold in the United States and Canada. UPC-A predates EAN-13 and is technically compatible with it, since an EAN-13 code with a leading zero encodes the same data as a UPC-A code.

Send BarGen 11 digits with format set to upca, and the API calculates the 12th check digit using the standard UPC modulo-10 algorithm. Results return as SVG for packaging and print production or PNG for online listings and previews, matching the exact bar widths and guard pattern spacing required for reliable POS scanning.

UPC-A (Universal Product Code) is the standard barcode format used for retail products in the United States and Canada. Introduced in 1974, it was the first barcode format to be widely adopted in retail.

The barcode consists of 12 digits: a single digit number system, a 5-digit manufacturer code, a 5-digit product code, and a check digit. The number system digit indicates the type of product (0 for regular items, 2 for weighted items, etc.).

UPC-A revolutionized retail by enabling automated checkout and inventory management. The first product scanned with a UPC barcode was a pack of Wrigley's gum at a Marsh supermarket in Ohio on June 26, 1974.

While primarily used in North America, UPC-A is compatible with the global EAN-13 system. Any UPC-A code can be converted to EAN-13 by adding a leading zero, enabling international trade.

Common use cases

North American retail packaging

UPC-A appears on essentially every consumer product sold through U.S. and Canadian grocery, pharmacy, and big-box retailers, since it is the region default POS barcode.

Online marketplace listings

Sellers on Amazon, Walmart Marketplace, and similar platforms must supply a UPC-A or GTIN to list new products, so accurate UPC generation is a listing prerequisite.

Manufacturer product registration

Manufacturers generate UPC-A codes from their GS1-issued company prefix when launching new SKUs, embedding the code in packaging artwork before print production.

Generate UPC-A via the REST API

curl "https://api.bargen.pro/v1/barcode/upca?data=01234567890&format=svg" \
  -H "X-API-Key: YOUR_API_KEY"

Returns the barcode as SVG. See the API documentation for all options.

Frequently asked questions

How many digits do I need to supply for UPC-A?

Supply 11 digits; BarGen calculates and appends the 12th check digit automatically using the standard UPC modulo-10 formula, producing a fully valid, scannable code.

Is UPC-A compatible with EAN-13 scanners?

Yes. Every EAN-13 scanner also reads UPC-A, since a UPC-A code is equivalent to an EAN-13 code with a leading zero. This is why global retailers standardized on EAN-13 as the superset format.

Can I generate a UPC-A code without a registered GS1 prefix?

Technically yes for testing or internal use, but for retail distribution the manufacturer code portion must come from a GS1-issued company prefix to avoid duplicating another company product identifiers.

Specifications

Digits
12 (including check digit)
Structure
System + Manufacturer + Product + Check
Check Digit
Modulo 10 (mandatory)

Availability

Available from the Free plan.

See pricing

Related formats

Start generating UPC-A barcodes

Free tier with 1,000 API calls per month. No credit card required.