# A question about bar codes and qr codes

**URL:** <https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170>\
**Category:** Factual Questions\
**Created:** [February 25, 2019, 11:08am UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170 "2019-02-25T11:08:13Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [February 26, 2019, 5:39pm UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/21 "2019-02-26T17:39:05Z")

</div>

**xnylder** , that’s not really a compact package: The image itself might look small, but all of the heavy lifting is done by the headers that you don’t see on your screen. You could make the visible part of the image anything you want, including something super-tiny like 64 pixels, but the filesize would still be the size of the complete works of Shakespeare (zip compressed).

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [March 2, 2019, 12:08am UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/22 "2019-03-02T00:08:32Z")

</div>

> [@xnylder](#):
>
> Beautifully done.
> 
> Since the question’s been answered, here’s a solution that’s got even more information in a compact package: [The complete works of Shakespeare encoded inside a .jpg file](https://www.theverge.com/2018/11/1/18051514/twitter-image-steganography-shakespeare-unzip-me).

The visible image is small but the file size is… well, not huge because English text compresses pretty well, but a lot bigger than an image that small would normally be.

In short, most of the file is dead weight as far as putting image on the screen, and that dead weight is the complete works of Shakespeare.

---

<div class="post-metadata">

**Author:** ![TokyoBayer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tokyobayer/32/13989_2.png) [@TokyoBayer](https://boards.straightdope.com/u/TokyoBayer)\
**Post date:** [March 3, 2019, 2:40am UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/23 "2019-03-03T02:40:51Z")

</div>

> [@rock\_party](#):
>
> I’ve always wondered how much info is encoded on a barcode. Like the particular batch of canned peaches…where they were distributed to, ect. I’m thinking about something like the Tylenol poisoning. Could you find out where the product came from just from the barcode. Or if you return the canned peaches to a different store…could they say, “nope, wasn’t purchased here!”

If you read through this thread, you can discover that the importance of barcodes is that they can refer you to databases. There is absolutely no need to encode distribution information in a barcode. Zero.

For current manufacturing processes, it would be a nightmare and add complexity and make many, if not most products unprofitable.

The inefficiencies introduced would drive process engineers into insane asylums. Instead of printing boxes in batches of thousands or tens of thousands, you have to break the batches up for each individual store. Then store then. Then make sure that the right box goes to the right place.

Manufacturing in bulk just dies. Everyone becomes manufactured after an order. Then shipped from China. Etc. etc. etc. And everything needs to be separated and tracked.

Products with individual serial numbers can be tracked now. It simply makes no economic sense to do that with cans of peaches.

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [March 3, 2019, 3:54am UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/24 "2019-03-03T03:54:36Z")

</div>

> [@TokyoBayer](#):
>
> If you read through this thread, you can discover that the importance of barcodes is that they can refer you to databases. There is absolutely no need to encode distribution information in a barcode. Zero.

Agreed, and to elaborate…

It is axiomatic in database management that info not be duplicated, but referenced. As long as you can provide a unique product identifier, no additional info needs to be encoded on the product itself, as it can be looked up (and maintained) elsewhere.

OTOH, it is theoretically possible to encode anything and everything you want in a barcode as long as the character set allows (some character sets are numeric only). A colleague and I once devised a barcode that allowed the complete (at the time) ASCII 127 character set to be printed and read. It was intended to make short programs – in languages such as Assembly or Basic – cheaply printable in magazines or flyers. The recipient could enter the entire program to his computer by scanning a few lines on a page in seconds.

It worked very well, but was eclipsed by the decreasing cost and universality of portable media plus the increasing length of programs.

---

<div class="post-metadata">

**Author:** ![Darren\_Garrison](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/darren_garrison/32/92_2.png) [@Darren\_Garrison](https://boards.straightdope.com/u/Darren_Garrison)\
**Post date:** [March 3, 2019, 4:19pm UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/25 "2019-03-03T16:19:05Z")

</div>

> [@Musicat](#):
>
> A colleague and I once devised a barcode that allowed the complete (at the time) ASCII 127 character set to be printed and read. It was intended to make short programs – in languages such as Assembly or Basic – cheaply printable in magazines or flyers. The recipient could enter the entire program to his computer by scanning a few lines on a page in seconds.

You could have marketed your own barcode reader, called the Musicuecat.

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [March 3, 2019, 6:47pm UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/26 "2019-03-03T18:47:22Z")

</div>

> [@Darren\_Garrison](#):
>
> You could have marketed your own barcode reader, called the Musicuecat.

Good idea, only 40 years too late. And we would have probably been sued by CueCat, another good idea that failed.

(On retrospect, since [:CueCat](https://en.wikipedia.org/wiki/CueCat) came 20 years later, maybe we would have sued them!)

We actually did market a product which we called _the Bartender,_ which was able to read 7 common codes in use at the time, including the ASCII-complete code, which we called _Bytewrite_. The device also provided a data stream for any of the 7 barcodes, data that could be used to drive any printer that could be addressed by simple coordinates, like a dot-matrix graphic device.

---

<div class="post-metadata">

**Author:** ![Ranger\_Jeff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ranger_jeff/32/2065_2.png) [@Ranger\_Jeff](https://boards.straightdope.com/u/Ranger_Jeff)\
**Post date:** [March 3, 2019, 7:24pm UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/27 "2019-03-03T19:24:19Z")

</div>

Where I once worked there were SKU numbers. A long SKU and a short SKU.

[https://jumbotron-production-f.squarecdn.com/assets/4701fe06c198422da8cd.png](https://jumbotron-production-f.squarecdn.com/assets/4701fe06c198422da8cd.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Garrison](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/darren_garrison/32/92_2.png) [@Darren\_Garrison](https://boards.straightdope.com/u/Darren_Garrison)\
**Post date:** [March 3, 2019, 7:26pm UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/28 "2019-03-03T19:26:25Z")

</div>

> [@Musicat](#):
>
> We actually did market a product which we called _the Bartender,_ which was able to read 7 common codes in use at the time, including the ASCII-complete code, which we called _Bytewrite_.

Actually (smugly correcting the guy who worked on it) [it could read 8 of them](http://www.s100computers.com/Hardware%20Manuals/I-O%20Technology/Bar%20Code%20Reader.pdf).

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [March 3, 2019, 8:06pm UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/29 "2019-03-03T20:06:17Z")

</div>

> [@rock\_party](#):
>
> I’ve always wondered how much info is encoded on a barcode. Like the particular batch of canned peaches…where they were distributed to, ect. I’m thinking about something like the Tylenol poisoning. Could you find out where the product came from just from the barcode. Or if you return the canned peaches to a different store…could they say, “nope, wasn’t purchased here!”

No, it can’t. (Pr at least, it isn’t done that way.)

The can labels with the barcode already on them are produced by a printing company, thousands at a time, long before the peaches have even been picked. Then they are applied to the outside of cans after they are packed & sealed. (Every once in a while there is a story about a customer opening a can of peaches and finding plums inside – wrong batch of labels used.) It wouldn’t be economical to do it any other way.

But the expiration date information is added to the label or the end of the can as it comes off the production line. That often contains other information, like the plant, date, & shift that produced it, sometimes even the specific canning machine. That can be used by the producer to identify the source. (That’s why when you complain about a bad or contaminated product, the company will generally ask you to send them the entire package that it came in, so that they can get those production codes.)

---

<div class="post-metadata">

**Author:** ![leahcim](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@leahcim](https://boards.straightdope.com/u/leahcim)\
**Post date:** [March 3, 2019, 9:22pm UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/30 "2019-03-03T21:22:26Z")

</div>

> [@Ranger\_Jeff](#):
>
> Where I once worked there were SKU numbers. A long SKU and a short SKU.
> 
> [https://jumbotron-production-f.squarecdn.com/assets/4701fe06c198422da8cd.png](https://jumbotron-production-f.squarecdn.com/assets/4701fe06c198422da8cd.png)

SKU codes are not, in general, mean to be universal identifiers. The format, and what they mean is internal to a specific manufacturer/retailer.

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [March 3, 2019, 9:52pm UTC](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170/31 "2019-03-03T21:52:24Z")

</div>

UPC-E, a subset of UPC, was developed for use on very small items, like a pack of gum or a Lifesavers roll. Obviously it encoded less info than a longer code, since space was at a premium more then than now, but it worked. I am not up to speed on modern code specs, but I’m sure they are more liberal and flexible.

[Previous page](https://boards.straightdope.com/t/a-question-about-bar-codes-and-qr-codes/830170.md?page=1)
