✦ ✦ ✧
Future-Ready · Hidden Systems

How a barcode is read

A UPC-A barcode represents a twelve-digit identifier in bars and spaces. Its last digit helps a scanner detect some reading errors.
📊The parts of a UPC-A barcode
A ten-pack of chewing gum was the first product purchased with a standard UPC scanner at a supermarket in Troy, Ohio, on June 26, 1974. The purchaser kept the gum. The Smithsonian’s collection includes a scanner. The diagram uses a sample number for practice.
0 36000 29145 2 ↑ start guard ↑ middle guard end guard ↑ last digit: an arithmetic check Each digit is a fixed slice of 2 dark bars + 2 light spaces. 12 × 7 + 11 of guard = 95 slices wide. The two halves use different patterns so a scanner can read the symbol in either direction.
❌ The barcode does not contain the price. Not the name, not the size, not the expiry date. It holds an identifier and nothing more for an ordinary retail item. GS1 standards support assigning identifiers. The store can retrieve the item’s price and description through a database lookup. An ordinary sale price can change without reprinting the barcode. Other schemes for variable-weight items or coupons may encode a value.
🛡️Calculating the check digit
A package can be creased or a scan unclear. The last digit is chosen so the weighted sum is a multiple of ten. Try it with the sample number below.
pos 123456 789101112 0 3 6 0 0 0 2 9 1 4 5 2 the check digit ■ odd positions ■ even positions STEP 1 · ADD ODD POSITIONS 0 + 6 + 0 + 2 + 1 + 5 = 14 STEP 2 · MULTIPLY BY THREE 14 × 3 = 42 STEP 3 · ADD EVEN POSITIONS 3 + 0 + 0 + 9 + 4 = 16 STEP 4 · ADD THE RESULTS 42 + 16 = 58 STEP 5 · FIND A MULTIPLE OF 10 58 → the next one up is 60 STEP 6 · FIND THE DIFFERENCE 60 − 58 = 2 ✅ it matches! 🧮 Try another: for 1 2 3 4 5 6 7 8 9 0 1 → odd 26 × 3 = 78, even 20, total 98 → 100 − 98 = 2 So the full code is 1 2 3 4 5 6 7 8 9 0 1 2. If the weighted sum is already a multiple of ten, the check digit is zero.
⚖️Which errors does a check digit catch?
A SWAP THAT CHANGES THE CHECK DIGIT Correct: 1 2 3 4 5 6 7 8 9 0 1 → needs 2 Misread: 1 2 3 5 4 6 7 8 9 0 1 → needs 4 Printed 2; computed 4: mismatch. Detects every single-digit substitution. change any one digit and the total always misses its multiple of ten. Most neighbor swaps are detected. AN UNDETECTED SWAP Swap two neighbours that differ by exactly 5 and the check stays the same: 2 7 0000000007 and 7 2 0000000007 both pass the test. Check each weighted sum. A check digit signals a mismatch. It cannot repair the digit. Detecting an error and fixing one are different jobs. 👉
⬛Comparing UPC-A and QR
📊UPC Barcodeone direction · 1974
one LINE of information
HoldsTwelve digits identifying an ordinary retail item.
Error checkA check digit can detect a mismatch.
The check alone does not repair a misread.
⬛QR Codetwo directions · 1994
A two-dimensional grid
The corner squaresCalled finder patterns. They let a camera spot the code and work out its orientation, so you can scan it sideways.
Its guardError correction uses additional codewords to recover missing or damaged information within limits.
Recovery depends on the damage and level.
APPROXIMATE QR ERROR-CORRECTION LEVELS about 7% of total codewords about 15% about 25% about 30% at the highest level shown A logo can obscure some data. Whether the code still scans depends on its placement and damage.
🔔A scan at the checkout
One scan can link several store systems. They share an item identifier so the register can retrieve its price and record the sale.
🔔 ONE BEEP POINT-OF-SALE SYSTEM takes the number → finds its row in the database RECEIPT AND PAYMENT name and price come from the database, not the stripes 📉 INVENTORY − 1 stock count changes after a completed sale 📦 REORDER TRIGGER count drops past a threshold may trigger an order A parcel scan at picking, loading, sorting or delivery can add a timestamped row. A tracking page can show recorded events, not a continuous location.
🔍Reading a QR link
A QR code can contain text or other data. It may hold a web address that you cannot read directly from the pattern. A preview gives clues about the destination.
① Read the preview. It cannot verify the site. If it matters, use an app or address you already know. ② In public, if a code is pasted on top of another code, leave it alone. Use a known address instead. TWO FICTIONAL ADDRESSES gamegrove.com/shop Here the host is gamegrove.com. gamegrove-rewards.zapmail-login.co Familiar name, other host.
Read the host carefully. A familiar name in a path or subdomain does not identify the organization behind the site. If a link asks for an important action, ask “Do I recognize the destination?” You can use a known address instead or ask a trusted adult.
🔑Key Terms
📊BarcodeA machine-readable pattern. A UPC-A symbol represents digits in alternating bars and spaces.
🏷️UPCUniversal Product Code. The common UPC-A format encodes twelve digits used to identify a retail trade item.
🔦ScannerA device that reads the pattern of a code optically and decodes its data.
🛡️Check digitA digit calculated from the other digits. A failed check can reveal a reading error.
⬛QR codeA two-dimensional code that can hold text or other data, including a web address.
🩹Error correctionExtra information built into a code that lets a reader rebuild some damaged or missing data, depending on the level and location of the damage.
🗄️DatabaseAn organized collection of records. A store can use a product identifier to look up a matching record.
🧾Point-of-sale systemCheckout software that can look up a product, record a sale, process payment and update inventory.
Two more worth knowing: inventory records goods on hand. A sale, return, delivery or correction can change it. Parcel tracking uses scans and timestamps to report a shipment’s recorded progress.
🌍Uses of barcode scans
🏥Hospital bedsidesA clinician may scan a patient’s wristband and the medication label and compare them with the order. A mismatch may trigger an alert for the clinician to investigate. The software does not establish by itself that every detail is correct.
🚚Warehouses & delivery routesParcel scans can record events at a warehouse, sorting hub or delivery point. A tracking page can display those reports even when no new scan has arrived.
🏖️The idea came from Morse code and a beach. In 1949 an engineer named Norman Joseph Woodland drew lines in sand while thinking about how a scanner could read a code. Woodland and Bernard Silver received a patent in 1952.
⏳The first grocery UPC scan came 22 years after the 1952 patent. Creating a shared product standard and installing readers, registers and computer systems took time.
📚The same alternating 1-and-3 weighting that guards supermarket barcodes also guards the ISBN-13 identifier used for books since 2007. Its alternating weights start with 1; UPC-A’s eleven data positions begin with 3.
📌Checking an identifier
1An ordinary retail UPC-A symbol carries a product number. A store can look up the name and price in a database using that number. Some variable-weight labels and coupons use other conventions.
2A UPC’s last digit is a check digit. Weight the first eleven digits in alternating 3s and 1s. Choose the last digit so the total is divisible by ten. The check catches a single changed digit and many swaps, but a swap of neighbors differing by five passes. A check digit cannot reconstruct the intended number from a mismatch alone.
3A QR code uses a two-dimensional grid. Corner marks help with orientation, and error correction can restore some missing information. If the code contains a link, use a trusted route for important actions.
🤔 Think about it
A UPC check can detect an error without correcting it. When would you prefer a system that reports a mismatch rather than one that guesses at the missing information?
A tracking page lists several scans but no updates for a day. What can you conclude from the last timestamp? Which records should the carrier keep?
⭐ Check the two sample codes whose first digits are 2 and 7. Why do they both pass after swapping those digits? What does that example tell you about the limits of the check?
✏️ ClickClass Anchor Chart · The Secret Life of Barcodes
ClickClass offers hundreds of free printables at clickclassedu.com/printables.