Barcodes: EAN-13, UPC-A, Code 128 and QR
Different barcodes do different jobs. Shops scan EAN-13 and UPC-A, the product numbers on almost every retail package. Warehouses and shipping labels use Code 128, which can hold letters as well as digits. QR codes store longer text, such as a link, and are read by phone cameras.
This generator draws all four in your browser. For EAN-13 and UPC-A it calculates the check digit for you, or verifies it if you enter one. Download the result as SVG for print or PNG for documents.
How to use it
- Choose the barcode type.
- Enter the data: 12 digits for EAN-13, 11 for UPC-A, or with the check digit as the last digit; any text for Code 128 and QR.
- Adjust the width and height, and choose whether to print the human-readable text underneath.
- Download SVG for print and design tools, or PNG for documents, then test-scan the result before printing in bulk.
Example: an EAN-13 with its check digit
400638133393
4006381333931
The 13th digit, 1, is the check digit calculated from the other twelve. Enter 4006381333932 instead and the tool refuses it, because 2 is not the right check digit.
Product barcodes need registered numbers
EAN-13 and UPC-A numbers are not free to choose for products you sell. Retailers expect numbers from GS1, the organisation that runs the system, because the first digits identify the company that owns the product. A made-up number may clash with another company's product. For internal use, such as library books or a stock room, numbers starting with 2 are reserved for in-store use and are safe.
How the check digit works
Starting from the rightmost data digit, the digits are multiplied alternately by 3 and 1 and added up. The check digit is the amount needed to reach the next multiple of 10. For 400638133393 the weighted sum is 89, so the check digit is 1. Scanners recalculate it on every scan, which catches nearly every misread.
UPC-A, used in the United States and Canada, is the same system with one digit fewer: a UPC-A code is an EAN-13 that starts with 0, which is why European scanners read American products without trouble.
Printing so it scans
Print in black on white or another strong contrast; red bars are invisible to many laser scanners. Keep the quiet zone, the empty margin left and right of the bars, and do not squash the code: retail barcodes should be printed close to their nominal size of about 37 by 26 millimetres for EAN-13. SVG keeps the bars perfectly sharp at any size.
Questions
Which characters can Code 128 hold?
This generator uses Code 128 set B: letters, digits, spaces and the usual printable ASCII symbols.
Is the QR code the same as the QR code generator's?
Yes. Both use the same QR encoder with error-correction level M. Use the QR Code Generator for size, colour and error-correction options.
Is anything uploaded?
No. Barcodes are drawn in your browser.