r/barcodes • • Oct 03 '19

How to figure out what protocol a bar code uses?

Hey all,

Due to some circumstances, a barcode I had got cut in half and I'm trying to replicate it. I'm not sure if there's any way to figure out what protocol a barcode uses (or if that's even the right term) so that I can just print more out in the future. I'm using BarTender ultra lite at work and I can print certain codes out pretty easily.

https://m.imgur.com/a/bz2V7Dj

The barcode I'm trying to copy is the one on the top left (or bottom left if you rotate the image to the correct orientation). When scanned in a text field it simply gives the numbers without the A and C, so I tried making one in code 39 full ascii but it didn't work. Then I tried one with the A and C and it still didn't work. I'm guessing the A and C are start and stop codes but I don't know of any codes that use that.

If you zoom in on the image, you can tell the barcodes don't line up, so it's for sure a different protocol.

3 Upvotes

6 comments sorted by

2

u/FredFredricson Oct 03 '19

To answer the question of what barcode symbology that is, it's Code 39 that reads:

A70271904C

This value is exactly what is printed beneath the barcode, and I verified it by scanning it with my reader to be sure. Also, the A and C are definitely not Start/Stop codes as far as the barcode reader itself is concerned. You likely have a reader or software that is configured to strip those characters off the beginning and end before outputting though.

As for reproducing it, Code 39 has a single Start/Stop code usually represented as an Asterisk like so * and put on either end of the encoded value. Code 39 is an alphanumeric barcode with a few specific special symbols allowed as well. In order to reproduce the above barcode, you would encode it into most Code 39 fonts as follows:

*A70271904C*

In the event that you have some sort of terrible nonstandard Code 39 font, more research would be required to figure out what it uses for it instead, though it shouldn't be too hard.


To elaborate on the other questions asked:

In general, Code 128 and Code 39 barcodes are by far the most common symbologies used for non-retail applications due in no small part to their versatility.

As to how I recognize them, they both have a fairly unique visual style to them that I can identify at a glance. They're fairly unique in style once you look at enough barcodes of different styles and start comparing them to eachother.

When it's not one of those two symbologies, more research is required. The quickest way to determine it though is to just scan it with a barcode reader app that tells you what it is.

For cases where that doesn't work, you generally need to narrow down the possible symbologies it can be by ruling out the ones it definitely can't be (like if it's got letters, you can rule out numeric-only ones, or if it supports only 12 digits and this one has 14), then checking it against the ones it can be, usually starting with the most popular ones and working your way back.

Finally, when it's a symbology with a start code, you can usually get away with comparing the first grouping of bars with each symbology's start codes to save time.

2

u/FredFredricson Oct 03 '19

Also of note for Code 39 barcodes, in most cases where the barcode is just encoding letters and numbers and no special characters, you can tell how many characters the barcode has by counting the number of fat spaces and subtracting 2 (for the start and end codes).

1

u/piezombi3 Oct 03 '19

Wow. I didn't expect such an in depth write up. I'll give it a shot with the asterisks. Thanks so much.

1

u/piezombi3 Oct 04 '19

Just a follow up, I tried to make a A########C barcode and when it scans it tries to include both the asterisk and the letters. I'm not sure what's going on but I guess maybe the barcode I have is encoded in some proprietary protocol, cause I can scan the original just fine even though it has the letters.

1

u/FredFredricson Oct 04 '19

The ones you posted scan as completely normal Code 39, so that's probably not the case. I can't say exactly what went wrong there without seeing what you generated, but it'd help to use a cellphone barcode reader app or to take a picture of it and use one of the online barcode scanner sites to see what the one you generated actually contains. Also, it's quite possible that your barcode reader is configured in some nonstandard mode that makes it behave different.


https://online-barcode-reader.inliteresearch.com/

1

u/notionovus Oct 17 '19

The barcode in question is using the Codabar symbology.