← IGCSE Computer Science Paper 1

Barcodes compared with QR codes

A barcode stores a short number in one dimension of lines; a QR code stores much more data in two dimensions of squares and can be read by a camera from any angle.

Understanding Barcodes compared with QR codes in IGCSE Computer Science Paper 1

What it does: A laser beam sweeps in one direction across the lines, so the barcode has to be facing the right way. A QR code has position squares in its corners, so the camera can work out its orientation and read it from any angle. A QR code uses a grid of squares in two dimensions, so it holds far more data than a barcode, which usually holds just a short number. Barcodes only store a short number. The shop's database looks up the name and price using that number. The QR code is two-dimensional, so it does not need to be lined up in a straight line like a 1D barcode.

Common mistakes: A QR code is 2D and a barcode is 1D, so qr_dims is greater than bar_dims. The comparison should use > so it prints True. A barcode stores data in one dimension (a row of lines), so bar_dims should be 1. Two dimensions describes a QR code.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 252–261) and word search (Modules 240–261).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which code stores data in only ONE dimension (a row of lines)?
BarcodeQR code
Matches
A barcode stores a web link in a grid of squares
↓
A barcode uses 1D lines and holds only a short number. A grid of squares and much more data describe a QR code.
Applying
Meanings
Term
1D barcode vs 2D QR code
Meaning
A barcode stores a short number in one dimension of lines; a QR code stores much more data in two dimensions of squares and can be read by a camera from any angle.
Practice
Barcode: 1D lines, short number
Testing
Gaps
barcode.dimensions ←
Check Answer
Spots
2qr_dims = 2
3print(qr_dims < bar_dims)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Camel' badge — Endurance Champion, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which code stores data in only ONE dimension (a row of lines)?
A. QR code
B. Barcode ✓
A barcode is 1D: the data runs left to right in lines of different widths. A QR code is 2D.
2. Which code can store much more data, such as a web address or a paragraph of text?
A. QR code ✓
B. Barcode
A QR code uses a grid of squares in two dimensions, so it holds far more data than a barcode, which usually holds just a short number.
3. A barcode on a packet of crisps usually stores...
A. A short number that identifies the product ✓
B. The whole description, price and photo of the product
Barcodes only store a short number. The shop's database looks up the name and price using that number.
4. Which statement about reading a QR code is correct?
A. A camera can read it from any angle ✓
B. It must be scanned in a straight line across the lines
QR codes have three corner squares that show the scanner which way round the code is, so it can be read from any angle. A basic barcode scanner needs the beam to cross the lines.
5. Which scanner is traditionally used to read a barcode at a supermarket till?
A. A 3D scanner that measures the shape of the packet
B. A laser scanner that sweeps a beam across the lines ✓
A laser scanner shines a red beam across the barcode and measures the light reflected back from the dark and light lines.

Match the Pairs

1D barcode → Stores a short number using one dimension of vertical lines, so it holds only a small amount of data
2D QR code → Stores much more data using a grid of squares in two dimensions, so it can hold web links and text
A laser scanner reads a barcode by sweeping a beam across the lines, so the barcode must be lined up with the scanner → laser scanner + 1D barcode
A camera-based scanner captures an image of a QR code, so it can read the code at any angle → camera + 2D QR code
A barcode stores a web link in a grid of squares → A barcode uses 1D lines and holds only a short number. A grid of squares and much more data describe a QR code.
A QR code is 1D, so it must be scanned in a straight line → A QR code is 2D, using width and height. Because of this it can be scanned from any angle.

Key Term

1D barcode vs 2D QR code
A barcode stores a short number in one dimension of lines; a QR code stores much more data in two dimensions of squares and can be read by a camera from any angle.

Fill in the Blanks

1. barcode.dimensions ← 1
Hint: Type the number of dimensions a barcode uses to store its lines.
2. qrCode.dimensions ← 2
Hint: Type the number of dimensions a QR code uses to store its squares.
3. IF dataLength > 20 THEN code ← "QR" ENDIF
Hint: Type the kind of code that can store a large amount of data.
4. qrCode.readAngle ← "any"
Hint: Type the word describing which scanning angles a QR code can be read from.
5. qrScanner.uses ← "camera"
Hint: Type the device a QR code scanner uses to capture an image of the code.

Spot the Error

Question 1
A bar_dims = 1
B qr_dims = 2
C print(qr_dims < bar_dims)
Line C — A QR code is 2D and a barcode is 1D, so qr_dims is greater than bar_dims. The comparison should use > so it prints True.
Question 2
A bar_dims = 2
B qr_dims = 2
C print("Barcode dims:", bar_dims)
Line A — A barcode stores data in one dimension (a row of lines), so bar_dims should be 1. Two dimensions describes a QR code.
Question 3
A def can_store_url(code)
B return code == "QR"
C print(can_store_url("QR"))
Line A — A function definition must end with a colon. It should be def can_store_url(code):
Question 4
A code = "QR"
B reader = "camera"
C if reader = "camera":
D print("Can read QR")
Line C — A single = assigns a value, but an if statement needs a comparison. It should be if reader == "camera": so the camera is checked.
Question 5
A data = "www.cloodit.com"
B code = "barcode"
C print("Use", code, "for a URL")
Line B — A barcode only holds a short number, so it cannot store a web address. A QR code stores much more data, so code should be "QR".

Student with a class code? Join your class →