Introduction
Need to generate a UPC barcode for a retail product? UPC (Universal Product Code) is the North American retail barcode standard managed by GS1. This tool generates scannable UPC-A barcodes using JsBarcode. Enter your 11 or 12 digit code and the barcode renders as an SVG image you can save or print. The check digit is calculated automatically if you provide 11 digits. No data leaves your browser.
What this tool does
- Generates scannable UPC-A barcodes as SVG images using the JsBarcode library.
- Accepts 11 or 12 digit input. With 11 digits, the check digit is computed and appended automatically.
- Renders the barcode with human-readable text below the bars.
- Displays the barcode as a scalable SVG that can be saved or printed at any resolution.
- Runs entirely client-side with no network requests.
How this tool works
Enter 11 or 12 digits into the input field. If you enter 11 digits, the tool computes the UPC check digit (mod-10 with alternating weights of 3 and 1) and appends it. The barcode renders as an SVG image below the tool panel, with bars and human-readable digits. You can right-click the SVG to save it or print it directly. The barcode updates instantly as you type.
How UPC barcodes work
UPC-A is a 12-digit linear barcode symbology defined by GS1. It encodes 12 numeric digits using a pattern of bars and spaces of varying widths. The structure is: 1 digit number system (usually 0 for standard retail), 5 digits manufacturer code, 5 digits product code, and 1 digit check digit.
The check digit is computed using the GS1 mod-10 algorithm: multiply each of the first 11 digits by alternating weights of 3 and 1 (starting with 3 for the first digit), sum the products, and compute (10 - (sum mod 10)) mod 10. This is the same algorithm used by EAN-13.
UPC-A encodes each digit using two bar patterns: one set for the left half (digits 1-6, using odd parity) and one set for the right half (digits 7-12, using even parity). The barcode begins with a start guard pattern (bar-space-bar), has a center guard pattern (space-bar-space-bar-space) between the left and right halves, and ends with an end guard pattern (bar-space-bar). The guard patterns allow the scanner to determine the scanning direction.
UPC-A was introduced in 1973 by the Uniform Grocery Product Code Council (later GS1-US). It became the standard for North American retail products. In 2005, GS1 unified UPC and EAN under the GTIN standard, and most scanners worldwide can read both. A UPC-A code is equivalent to an EAN-13 code with a leading 0.
How to use this tool
- Enter 11 or 12 digits into the input field. For 11 digits, the check digit is computed automatically.
- The barcode renders as an SVG image below the tool panel.
- Right-click the SVG image to save it, or use your browser's print function to print it.
- Scan the printed barcode with any standard retail barcode scanner to verify it reads correctly.
Real-world examples
Generating a barcode for a new product
A small business owner registers with GS1 and receives the manufacturer code 12345. She assigns product code 67890 to a new item. She enters 01234567890 (11 digits, starting with 0 for standard retail) into the tool. The check digit is computed as 5, giving the full UPC 012345678905. The barcode renders and she prints it for her product label.
Verifying an existing UPC
A retailer receives a product with UPC 036000291452 (the famous Kellogg's Rice Krispies UPC). He enters the 12 digits into the tool and the barcode renders. He scans it with his POS scanner and it reads correctly, confirming the barcode is valid and scannable.
Creating a barcode for a small batch
A craft maker selling at local markets needs barcodes for a small batch of products. She uses her GS1 company prefix and assigns product codes. For each product, she enters the 11 digits into the tool, saves the SVG, and prints barcodes on adhesive labels. The barcodes scan correctly at participating retailers.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| UPC-A | 12 digits, mod-10 check digit | North American retail products |
| EAN-13 | 13 digits, mod-10 check digit | Global retail products (superset of UPC-A) |
| EAN-8 | 8 digits, mod-10 check digit | Small products where EAN-13 is too large |
| Code 128 | Variable length, full ASCII | Shipping, logistics, non-retail |
Limitations or considerations
This tool generates UPC-A barcodes (12 digits). It does not generate UPC-E (the compressed 6-digit variant for very small products). The tool accepts numeric input only. For non-retail barcodes with alphanumeric data, use the Code 128 format in the Barcode Generator tool. The generated SVG is suitable for printing at standard sizes. For production use, verify the barcode scans correctly with your target scanner before mass printing.
Frequently asked questions
What is the difference between UPC-A and UPC-E?
UPC-A is the standard 12-digit UPC barcode. UPC-E is a compressed 6-digit version used on very small products where a full UPC-A would not fit. UPC-E can only be used when the manufacturer code and product code contain enough zeros to allow compression. This tool generates UPC-A.
Can I use this barcode on Amazon or Shopify?
Yes, if you have a valid GS1-assigned UPC. Amazon and Shopify both accept UPC-A barcodes for product listing. You must obtain your UPC from GS1 (gs1.org); self-assigned UPCs may be rejected by some marketplaces.
How do I save the barcode image?
Right-click the SVG image and select 'Save image as' to save it as an SVG file. SVG files are scalable and can be opened in any browser or vector graphics editor. You can also print the page directly to get a physical copy.
Is UPC-A the same as EAN-13?
UPC-A is a subset of EAN-13. A UPC-A code is equivalent to an EAN-13 code with a leading 0. Since 2005, GS1 unified both under the GTIN standard. Most scanners worldwide can read both formats.
Conclusion
This UPC barcode generator creates scannable UPC-A barcodes as SVG images using JsBarcode. It computes the check digit automatically and renders instantly in your browser. For other barcode formats, try the Barcode Generator, the Code 93 Generator, or the ITF-14 Generator.