Padding binary with leading zeros
Extra 0s added at the left of a binary number to fill a fixed number of bits. They do not change its value: 101 and 00000101 both mean 5.
Understanding Padding binary with leading zeros in ACARA Digital Technologies Years 7–8
What it does: The zeros on the left add nothing to the place values, so 101 and 00000101 both equal 4 + 1 = 5. 65 in binary is 1000001, which is only 7 bits. Adding one leading zero makes a full 8-bit code, 01000001. Leading zeros are like writing 007 instead of 7. They fill space but the value stays the same. Fixed-length codes make it easy to know where one value ends and the next begins. Padding never makes the number bigger. Padding goes at the left, in front of the number. 11000000 would be 192, not 3. 101 already uses 3 bits, so you need 8 - 3 = 5 extra zeros on the left.
Common mistakes: Without the 0 in the format code, the number is padded with spaces instead of zeros. It should be "08b" so 5 becomes 00000101. Padding to a width of 3 leaves 101 unchanged. An 8-bit code needs zfill(8) to give 00000101.
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 128–152) and word search (Modules 69–152).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
leading zerosFill in the Blanks
Spot the Error
Student with a class code? Join your class →