I have written a simple barcode app using VNBarcodeObservation in iOS... it works perfectly fine on 12 and 13 digit UPCs. However, when I scan an older Star Wars toy with 11 digits in the UPC, it adds a 12th digit to the UPC. For example, the code "07628169570" is interpreted as "076281695709" (the 9 at the end is added). The website barcode.tex-it.com does the same thing if I say the 11 digit code is UPCA (see link - https://barcode.tec-it.com/en/UPCA?data=07628169570) - it appears it's trying to force an 11 digit barcode to act as a 12 digit UPCA, which is not what I want... I want it to read the 11 digits... Is there anything I can do to force VNBarcodeObservation to just look at the 11 digits? Simply dropping the last character isn't an option, because I need the app to also read 12 digit barcodes. I feel like I should be able to have the app use a different symbology on an 11 digit code, but I'm not sure how. Thanks.
1 Answers
There is no 11-digit UPC-A.
The specifications of UPC-A are 12 digits, and 13 digits are compatible with EAN.
Universal Product Code - Wikipedia
International Article Number
The web service site you used was entered with 11 digits of data as UPC-A, so it probably complemented the check digit and displayed the correct UPC-A barcode.
For example, the barcode printing function of a receipt printer has such a complementary process.
If the 11-digit number is printed with the barcode attached(There are called Human Readable Interpretation characters), it probably omits the check digit.
It is conceivable that we have a unique operation that makes a difference in order to distinguish between the case where the barcode is read by the scanner device and the case where it is input by a human.
Wouldn't the application automatically calculate the check digit if entered by a human?
Or maybe you change the setting so that the notification from the scanner device is only 11 digits with the check digit removed.
If you have a product with an 11-digit HRI bar code, find out why it's 11-digit.
There may be some specifications that you have to consider.

- 4,060
- 2
- 10
- 30
-
Kenner Star Wars toys used 11 digits in the early 80s... that's what I'm trying to figure out... how to make sure the scanner interprets it as 11 digits and doesn't try to convert it to 12 or 13 - For example, this Biker Scout from 1983 has a barcode of 07628169570 (image on link - https://www.hobbydb.com/marketplaces/hobbydb/catalog_items/biker-scout-long-mouthpiece) - but when I scan it with an android or iOS scanner, it converts it to 076281695709 - it adds the extra 9. – Zachary Fisher Feb 26 '21 at 14:01
-
If so, perhaps the manufacturer that created/sold the product, or the system or database that registered the product code data, did not comply with UPC-A for some reason. If you need to deal with a product that has such a historical reason, consider detecting such a special barcode and taking special action. – kunif Feb 26 '21 at 14:12
-
Ok, so that's what I think I need help with... how can I get the iOS VNBarcodeObservation to accept the fact that the 11 digit barcode is NOT a UPC... even when I look at the raw data of the scan, the VNBarcodeObservation is using the UPCA symbology and including 12 digits... I'm not sure how to make it show me the 11 digits... – Zachary Fisher Feb 26 '21 at 19:43
-
By the way, have you ever tried to have a scanner device (VNBarcodeObservation, other common hardware scanners, etc.) read the actual barcode printed on the box of this product? Isn't the information on this web page just wrong? – kunif Feb 26 '21 at 22:42
-
Fair question. I’ve tried two other scanner apps and they add the extra digit to the 11 digits as well (for a 12 digit result). But surely there is a way to scan and read just the 11 digits showing? The issue is that our data workers input the information from the box, and we are trying to make the scanner provide the same 11 digit result. – Zachary Fisher Feb 27 '21 at 00:22
-
It's best to contact the administrator of the website to correct the information. If you search from the company number(76281) included in the corresponding barcode, the manufacturer seems to be `Hasbro, Inc.`, so it is unlikely that the company will use a barcode that does not comply with UPC-A. – kunif Feb 27 '21 at 01:07
-
Still, if only you want to deal with something, you have two options. If there is an option in VNBarcodeObservation(Vision.framework) to prevent the check digit from being notified, try specifying it. However, all barcodes within the influence range of that option will no longer notify you of the check digit. The other is to accept the data notified by VNBarcodeObservation, and then determine whether the barcode requires special action on the application side and deal with it. – kunif Feb 27 '21 at 01:21
-
Yes. Sorry for the confusion. I’m the administrator of the website. The barcode is Kenner (it’s a vintage Star Wars figure from 1983). The issue is we want the website to reflect the 11 digits on the card and would like the reader to recognize the 11 digits and not add a 12th. I don’t believe the VNBarcodeObservation allows a method to report the check digit, but I’ll do some digging. That’s what I was hoping to find out here... that someone had experienced this and found a way... – Zachary Fisher Feb 27 '21 at 12:53
-
All you can do is arrange what you are responsible for, and you cannot change the specifications of the world's scanner hardware/software/POS systems. Isn't it better to add facts as notes to the data posted on the website? In other words, it should be clearly stated that the barcode printed as HRI is 11 digits, but when read by a scanner, it is a 12 digit UPC-A. – kunif Feb 27 '21 at 13:23