Education Technology

Check Digit

Activity Overview

Have you ever wondered about how bar-codes work? This activity looks at the numbers that make up a bar code, specifically the algorithm that formulates the check digit. Students use the information about the algorithm to write some code to automatically check the validity of a bar code. 


This activity provides students with the algorithm for the check-digit on a barcode. This activity provides minimal scaffolding for the coding of the algorithm with a view to making students more independent when it comes to writing their own programs. There are many useful resources available to support students, including the 10 Minutes of Code lessons and a series of YouTube tutorials.


  • For - EndFor
  • If - Then - Else - EndIf
  • RequestStr
  • Mid

About the Lesson

An algorithm exists for the check-digit on a barcode. In this activity students develop their own program based around the algorithm. Students can watch any of the 10 minutes of code tutorials to help formulate a program to validate any barcode.