Binary and Number Systems
Work confidently with bits, bytes, hexadecimal, and powers of two so addressing and storage maths stop being guesswork.
- Certification
- CompTIA A+
- Recommended study time
- 4h 30m
- Status
- Not started
Recommended study time
About 4h 30m in total, measured from the material on this page. At your session length of 45 minutes that is 6 sittings.
- Read the lesson20 min
About 2,614 words at a careful technical reading pace.
- Second pass with notes12 min
Re-read the harder parts and write your own notes.
- Recall from memory12 min
2 written recall questions.
- Practice decision12 min
One applied decision with feedback.
- Teach it back20 min
Write the topic in your own words.
- Real-world scenario15 min
Read the situation and justify your decision in writing.
- Hands-on practice2h
Labs, commands and configuration until you can do it unaided.
- Spaced review1h
4 short review sessions spread over the following weeks.
Learning objectives
- Convert between binary, decimal, and hexadecimal for values up to 255.
- Explain how bits, bytes, kilobytes, and gigabytes relate to real capacity figures.
- Use powers of two to reason about address ranges and host counts.
Start here
About 8 minutes of reading, in 10 short parts.
Computers only ever hold electricity as on or off, so every number, address, and permission a technician deals with is secretly built from those two states. This lesson gives you the arithmetic that sits underneath IP addresses, subnet masks, file permissions, and storage capacity claims.
Where you meet it: You use this whenever you calculate a subnet range, read a hex colour or MAC address, set a Linux permission mode, or explain why a '1 TB' drive shows less space in Windows.
The lesson, part by part
Open one part at a time. Each part stands on its own, so you can stop and come back.
Imagine you could only flip light switches on or off to represent numbers. One switch gives you two possibilities: off or on. Two switches give you four combinations. Every extra switch doubles what you can represent. That is exactly how a computer counts, except the switches are transistors and there can be billions of them.
Humans count in tens because we have ten fingers. Computers count in twos because a transistor is easiest to build as a simple on/off device. Hexadecimal is just a shorthand humans invented so we do not have to write out long strings of ones and zeros; it groups four switches at a time into a single symbol, the same way we might group four coins into a stack instead of counting them one by one.
Key ideas
If you remember nothing else from this topic, remember these.
- Binary is base-2 and every bit position is a power of two, so a byte holds values from 0 to 255.
- Hexadecimal groups four bits into one digit, which is why MAC addresses and memory addresses are written in hex.
- Octal groups three bits into one digit, which is exactly why Linux permission modes like 644 or 755 make sense.
- Storage vendors advertise decimal gigabytes (10^9 bytes) while operating systems report binary gibibytes (2^30 bytes), which explains the gap between an advertised and displayed drive capacity.
- A /24 subnet mask is 11111111.11111111.11111111.00000000 in binary, and counting the zero bits tells you the host capacity directly.
- Converting by hand, not relying only on a calculator, is what lets you catch a wrong subnet or a mistyped hex string during live troubleshooting.
Sizing a subnet and explaining a drive capacity discrepancy
A worked example, step by step.
A customer buys a 500 GB SSD, sees 465 GB in Windows, and also wants to know how many usable addresses their new /27 subnet provides. You need to resolve both using the same binary skills.
- 01Step 1Write the /27 mask in binary: 11111111.11111111.11111111.11100000, since /27 means 27 one-bits from the left.
- 02Step 2Count the remaining zero bits in the last octet: 5 zero bits (11100000 leaves 5 positions unset).
- 03Step 3Compute total addresses as 2^5 = 32, then subtract 2 for the network and broadcast addresses, giving 30 usable hosts.
- 04Step 4Open a terminal and run ipconfig /all on Windows or ip addr on Linux to confirm the assigned mask matches 255.255.255.224, the decimal form of that binary mask.
- 05Step 5For the drive question, convert the advertised 500,000,000,000 bytes by dividing by 2^30 (1,073,741,824) to get roughly 465.7 GiB, matching what File Explorer shows.
- 06Step 6Open Disk Management (diskmgmt.msc) and confirm the reported disk size in GB, showing it lines up with the binary calculation rather than a manufacturing defect.
- 07Step 7Explain to the customer, using the 10^9 versus 2^30 distinction, that no capacity is missing, it is a different counting base.
- 08Step 8Document both answers in the ticket: the subnet supports 30 hosts, and the drive discrepancy is expected behavior, not a fault.
Outcome: The customer understands the drive is functioning correctly, and the network build proceeds with a correctly sized /27 subnet supporting 30 usable devices.
Number System Quick Reference
Worth keeping at hand while you work.
- Bit
- Single binary digit, 0 or 1
- Byte
- 8 bits, maximum unsigned value 255
- Nibble
- 4 bits, equals one hex digit
- Hex digit range
- 0-9, A-F representing 0-15
- Octal digit range
- 0-7, representing 3 bits
- chmod 644
- Owner read/write, group read, others read
- chmod 755
- Owner full, group and others read/execute
- 1 KB (decimal)
- 1,000 bytes, used in marketing
- 1 KiB (binary)
- 1,024 bytes, used by the OS
- /24 subnet
- 255.255.255.0, 254 usable hosts
- /30 subnet
- 255.255.255.252, 2 usable hosts, common for point-to-point links
- 0xFF
- Hex for decimal 255, binary 11111111
Common misunderstandings
What most beginners get wrong here.
A missing amount of storage space means the drive is defective.
It almost always reflects decimal-versus-binary counting, not a hardware fault.
Hexadecimal and decimal digits can be mixed freely.
Hex uses A-F for 10-15; any digit outside 0-9A-F is invalid in a hex value.
Subnet host count equals 2 raised to the host bits with no adjustment.
You must subtract 2 for the network and broadcast addresses to get usable hosts.
Binary and octal are basically the same thing.
Octal is base-8 grouping 3 bits at a time; binary is the raw base-2 representation itself.
chmod 777 is a safe default when a permission error appears.
It grants full access to everyone and should only be used deliberately, if ever, not as a fix-all.
Exam traps
How the question writers try to catch you out.
- Expect a question giving a subnet mask and asking for usable host count, requiring the minus-2 adjustment.
- A question may show a byte value and ask for its hex equivalent, testing nibble-splitting skill directly.
- Watch for questions distinguishing GB (10^9) from GiB (2^30) when explaining a capacity discrepancy to a customer.
- A performance-based question may ask you to identify the correct binary octet for a given decimal IP address component.
- Some questions describe a Linux permission scenario and expect you to interpret or set the correct octal mode.
Check yourself
Answer in your head first, then reveal. This is not scored.
What is 200 in binary?
How many usable hosts does a /28 subnet provide?
What does chmod 640 grant?
Why is hex used for MAC addresses instead of binary?
What causes a 1 TB drive to show 931 GB in Windows?
Quick reference
A condensed summary of the lesson above, for revision.
What It Is
Binary is a base-2 numbering system using only 0 and 1, matching the two electrical states hardware can hold reliably. Each position represents a power of two. Hexadecimal is base 16 and compresses four binary digits into one character, which is why MAC addresses, colour codes, and memory dumps use it.
Why It Matters
An IPv4 octet is eight bits, so its maximum value is 255. A /26 network leaves six host bits, so it holds 64 addresses and 62 usable hosts. Linux permission mode 755 is three octal digits describing read, write, and execute bits. None of that is memorisable without the underlying number sense.
How It Works
- Each binary position doubles in value from right to left: 1, 2, 4, 8, 16, 32, 64, 128.
- To convert decimal to binary, subtract the largest fitting power of two and repeat with the remainder.
- Group binary in fours to read hexadecimal, and in threes to read octal permissions.
Where You See It
- IP addresses and subnet masks, MAC addresses, Linux permission modes, storage capacity, colour codes, and hex dumps in forensics tools.
Key Terms
- Bit
- A single binary digit holding 0 or 1.
- Byte
- Eight bits, the usual smallest addressable unit of storage.
- Hexadecimal
- Base-16 notation where one character represents four bits.
- Power of two
- The place value of each binary position: 1, 2, 4, 8, 16, 32, 64, 128.
- Octal
- Base-8 notation used for Unix permission modes.
Examples
- The binary value 11000000 is 192, the first octet of the private range 192.168.0.0/16.
- A drive advertised as 1 TB shows roughly 931 GiB in Windows because the vendor counts in powers of ten and the OS reports powers of two.
Common Problems
- Confusing GB with GiB
- Off-by-one host counts
- Misreading hex bytes
- Forgetting the network and broadcast addresses
How It Fails
- A miscounted mask assigns hosts to the wrong subnet and breaks routing.
- Wrong octal permissions either lock users out or expose files.
- Capacity planning based on decimal marketing figures leaves less usable space than expected.
How to Troubleshoot
- Rewrite the value in binary before arguing about it.
- Check whether a tool reports base-2 or base-10 units.
- Recount host capacity as 2^(host bits) minus two for standard IPv4 subnets.
Practical Knowledge
- Memorise 128/192/224/240/248/252/254/255 as the only valid mask octets.
- Hex pairs map directly to bytes, which makes packet captures readable.
Exam Coverage
- Binary and hexadecimal conversion
- Storage units and capacity maths
- Powers of two behind addressing
Interview Questions
- Why does an IPv4 octet stop at 255?
- How many usable hosts are in a /28 and how did you work it out?
Watch and read
Verified official and reputable sources for this topic. Links open in a new tab.
Video training
Reading and courses
Lesson notes and bookmark
Notes and bookmarks for this lesson, saved with everything else you have marked.
No notes on this item yet.
Learning progress
0% across six evidence areas. Reading alone does not change progress.
Prerequisites
Next steps
- 01Convert the four octets of your own IPv4 address into binary by hand.
- 02Write the values 1 through 32 as powers of two and memorise the first eight.