Xerobit

UPC Generator: Create Scannable UPC-A Barcodes

Enter 11 digits to compute the check digit and draw a scannable UPC-A barcode, or enter 12 digits to validate an existing code. The upc generator runs entirely in your browser so nothing is uploaded. It produces an SVG image you can save or print directly.

Barcode

012345678905
  • UPC-A
    012345678905
  • Check digit
    5 (computed)
  • Number system
    0

    General merchandise

  • Manufacturer code
    12345
  • Product code
    67890

How to use the upc generator

  1. Enter 11 digits to have the check digit calculated automatically, or 12 digits to validate an existing UPC-A code.
  2. Adjust the bar height and choose whether to display the human-readable digits beneath the bars.
  3. Select a white or transparent background depending on where you plan to use the image.
  4. The upc generator instantly renders a scannable SVG barcode and breaks down every part of the number below it.

How the UPC-A check digit is calculated

A UPC-A code has 12 digits. The last one is a check digit computed from the first 11 using a modulo-10 algorithm. Add the digits in odd positions (1st, 3rd, 5th, 7th, 9th, 11th) and multiply the sum by 3. Then add the digits in even positions (2nd, 4th, 6th, 8th, 10th). Take the total modulo 10; if the result is not zero, subtract it from 10 to get the check digit.

For example, with the 11 digits 01234567890: odd-position sum is 0+2+4+6+8+0 = 20, multiplied by 3 gives 60. Even-position sum is 1+3+5+7+9 = 25. Total is 85. Since 85 mod 10 = 5, the check digit is 10 - 5 = 5, making the full code 012345678905.

Structure of a UPC-A number

The 12 digits in a UPC-A barcode are divided into four parts that carry specific meaning for retailers and manufacturers.

PartDigitsPurpose
Number system1Identifies the product category: 0 or 1 for most groceries, 3 for pharmaceuticals, 5 for coupons.
Manufacturer code5Assigned by GS1 US to uniquely identify the company.
Product code5Assigned by the manufacturer to identify the specific item.
Check digit1Mathematically derived to catch scanning or typing errors.

This structure allows over 100,000 manufacturers and 100,000 products per manufacturer under each number system digit.

How the barcode pattern is drawn

A UPC-A barcode encodes each digit as a pattern of two bars and two spaces, each exactly 7 modules wide. The left six digits use L-codes (odd parity, starting with a space), while the right six digits use R-codes (even parity, starting with a bar). This parity difference lets scanners determine the reading direction.

The symbol always begins with a start guard pattern 101 (bar-space-bar), followed by a centre guard 01010 (space-bar-space-bar-space) between the sixth and seventh digits, and ends with a stop guard 101. Quiet zones of at least 9 modules on each side ensure reliable scanning. Each module is typically rendered as one unit of width in the SVG output of this upc generator.

UPC-A versus other barcode formats

UPC-A is the standard retail barcode in North America, encoding exactly 12 numeric digits. If you need to encode letters, punctuation or variable-length data, consider a Code 128 barcode generator which supports the full ASCII character set. For simpler alphanumeric labels such as inventory tags, a Code 39 barcode generator may be more appropriate.

When you need a general-purpose tool that handles multiple symbologies, a broader barcode generator can produce several formats from one interface. For two-dimensional codes that store much more data in a small area, look at a Data Matrix generator instead.

Practical uses for generated UPC barcodes

Small businesses and independent sellers often need UPC-A barcodes for product listings on marketplaces that require them. Developers building point-of-sale systems use test codes during integration. Packaging designers embed the SVG directly into label artwork without relying on raster images that lose quality when scaled.

Because this upc generator outputs a vector SVG, the barcode remains crisp at any print size. Set the background to transparent when placing the code over coloured packaging, or keep it white for standard paper labels. Always verify the printed barcode with a physical scanner before committing to a production run.

Worked examples

Each result below was produced by the same code the tool runs, so you can check your own numbers against them.

ExampleInputResult
Standard test codeDigits (11 or 12): 01234567890; Bar height (px): 80; Show digits below bars: yes; Background: whiteUPC-A: 012345678905; Check digit: 5 (computed); Number system: 0; Manufacturer code: 12345; Product code: 67890
Validate 12-digit codeDigits (11 or 12): 036000291452; Bar height (px): 80; Show digits below bars: yes; Background: whiteUPC-A: 036000291452; Check digit: 2 (valid); Number system: 0; Manufacturer code: 36000; Product code: 29145
Tall barcode, no textDigits (11 or 12): 12345678901; Bar height (px): 120; Show digits below bars: no; Background: whiteUPC-A: 123456789012; Check digit: 2 (computed); Number system: 1; Manufacturer code: 23456; Product code: 78901
Transparent backgroundDigits (11 or 12): 01234567890; Bar height (px): 80; Show digits below bars: yes; Background: transparentUPC-A: 012345678905; Check digit: 5 (computed); Number system: 0; Manufacturer code: 12345; Product code: 67890

FAQ

What is a UPC-A barcode?

UPC-A is the standard 12-digit numeric barcode used on retail products in North America. It encodes a number system digit, a five-digit manufacturer code, a five-digit product code and a single check digit.

Can I enter 12 digits instead of 11?

Yes. If you enter all 12 digits, the upc generator validates the check digit and alerts you if it is incorrect. If valid, it draws the barcode normally.

Is the generated barcode scannable?

Yes. The SVG follows the official UPC-A specification including correct L-code and R-code patterns, guard bars and quiet zones. Print it at an appropriate size and it will scan with standard hardware.

Does this tool upload my data anywhere?

No. All computation and rendering happens locally in your browser. No digits or images are sent to any server.

What do the L-codes and R-codes mean?

L-codes encode the left six digits using patterns that start with a space (odd parity). R-codes encode the right six digits using patterns that start with a bar (even parity). This asymmetry allows scanners to read the barcode in either direction.

Why would I choose a transparent background?

A transparent background lets you overlay the barcode on coloured packaging or designs without a white box around it. Use white for printing on plain paper.