system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do bar codes work?

The entire system is complete wizardry to me. The laser itself is witchcraft but the most amazing part is the database. I could imagine that stores somehow associate a code with a product when they add it to their inventory system but what prevents two manufacturers from using the same bar codes on different products. Is there a master database somewhere and who is responsible for managing it?


Edit: I really appreciate all the answers about the database aspect of this but I am still wondering how the actual laser works. Seems like it has to be fairly simple because the technology has been around for decades, long before 'modern' computers.
gpt
When a manufacturer produces a product it has to pay for each of those number codes that are attached to the bar code scanned at checkout. Yes each product has a unique barcode for itself. From type and size (think different size boxes of the same cereal at the store) the manufacturer pays for them. It’s a long number too right? It can be broken down like a phone number with area code first...it is more specific than that though. Starting with the general product type, then country it was manufactured in, then the manufacturer’s company code, then that specific products code. The bars above the number are kind of like a number code for the laser to read. The size and spacing represent separate numbers. Pretty cool and a universally accepted way to track purchases, keep stock of an inventory, and maintain the extensive catalog of products out there. 😊