UPC barcode generator
UPC-A for North American retail, and UPC-E for packages too small to carry it. Eleven digits and the check digit is computed; ask for the compressed form and you get it only when the number has one, which most numbers do not.
UPC-A is an EAN-13 wearing a different name
This one fact clears up most UPC confusion. A UPC-A is exactly an EAN-13 whose first digit is zero: the same 95 modules, the same guard bars, the same parity scheme. Feed one to a decoder and it will tell you it read an EAN-13, with a leading zero attached.
That is not the decoder being unhelpful. Nothing in the printed bars distinguishes the two, so there is nothing for it to report. The difference is regional convention about how the number is written and printed, and this page keeps both entries because both are what people look for.
UPC-E, and why it usually refuses
UPC-E squeezes a twelve digit UPC-A into six digits and 51 modules, against 95 for the full symbol. It manages that by exploiting runs of zeros in specific positions, and there are only four such patterns. If your number does not match one of them, no compressed form exists.
How often is that? Of the first two hundred thousand eleven digit codes, 1005 have a UPC-E form. About one in two hundred. So a refusal here is almost always correct, and a tool that always returns something has either invented a number or quietly changed yours.
That is not a hypothetical worry. An earlier version of this encoder had two of the four rules wrong, and the symptom was precise: 04252600001 compressed to a code that expanded back to a different product. The independent decoder caught it by insisting on a check digit of 4 where we produced 0. Round-tripping every compression against its own expansion is now a release condition.
Which one goes on the package
- UPC-A for anything with room. It is the default, every scanner reads it, and the digits are printed legibly underneath.
- UPC-E for small items, when the number happens to have a compressed form. Registers expand it back to the full twelve digits before doing anything with it.
- EAN-13 if the product is sold outside North America, which in practice means most products, since a UPC-A is already a valid EAN-13.
- EAN-8 for a small package whose number has no UPC-E form. It is a separately allocated number rather than a compression, so it needs a request to GS1.
Numbers for testing, and numbers for shelves
For a test suite, invent them. What matters is that the arithmetic is right and the geometry is right, and both are, so a scanner will behave exactly as it would with a real product. Generating a range of them is what the bulk pages are for.
For a product that will cross a checkout, the number must be issued to your company by GS1. This page has no way to check that and will encode whatever you type, which is the correct behavior for a tool and a bad basis for a product launch.
Questions
Why will this not compress my UPC-A to UPC-E?
Because it almost certainly has no UPC-E form. Compression works only for four specific patterns of zeros, and roughly one number in two hundred matches one. A tool that returns a compressed code for any input is giving you a code that expands to something other than what you typed.
Why does the decoder say EAN-13 when I asked for UPC-A?
Because the symbol is an EAN-13. A UPC-A is an EAN-13 with a leading zero, bit for bit, so the decoder is describing the image accurately. The name UPC-A is a labeling convention, not a different set of bars.
Should I use eleven digits or twelve?
Either. Eleven and the check digit is computed; twelve and it is verified, with the correct value reported if the last digit is wrong. The same applies to the eight digit compressed form.
Do UPC-E codes scan as reliably as UPC-A?
In principle yes, and in practice they are read less often, so they are worth testing specifically. A register has to recognize the compressed form and expand it, and that expansion step is a place implementations differ. Feeding both forms of the same product number through your system is a good check.
More barcode generators
Code 128 barcode generator · Code 39 barcode generator · GS1-128 barcode generator · ITF-14 barcode generator · Data Matrix generator · Aztec code generator · Barcode generator · QR code generator