Binary code represents information using two symbols, usually written as 0 and 1. To read a binary number, give each position a value and add the positions containing 1. To read binary as text, you also need to know which character encoding was used. The same bits can mean different things in different contexts.

Why do computers use zeros and ones?
A bit is one binary digit. It has two possible values. Those written digits describe states that hardware can distinguish, such as two ranges of electrical voltage; they are not tiny printed numerals inside a processor. Using two distinguishable states makes storing and processing information practical. The Computer Science Field Guide explains this two-state idea with physical examples.
A byte is eight bits in modern everyday computing. Eight bits have 256 possible patterns. If you use those patterns for unsigned whole numbers, they represent 0 through 255. Counting starts at zero, so 256 possibilities does not mean the largest value is 256.
How do binary place values work?
Decimal is base 10: its whole-number positions are ones, tens, hundreds, and so on. Binary is base 2, so each position doubles as you move left. Start at the right with 1, then write 2, 4, 8, 16, 32, 64, and 128. A 1 includes that position’s value; a 0 leaves it out. This is the positional system described in the Field Guide’s numbers chapter.
Position values: 128 64 32 16 8 4 2 1
Binary digits: 0 0 1 0 1 1 0 1
For this example, keep 32, 8, 4, and 1. Their sum is 45, so binary 00101101 represents decimal 45 when interpreted as an unsigned number. Read the digits individually as “zero zero one zero one one zero one,” rather than treating the string as a decimal number.
A useful check is the rightmost digit. In an unsigned whole number, a final 0 means even and a final 1 means odd. Our answer ends in 1, and 45 is odd. This catches some errors, although it cannot prove the whole conversion is correct.

How do you turn a decimal number into binary?
Work backward by choosing powers of two. To convert 45, start with 32, the largest power of two that fits. Subtract it to leave 13. Skip 16 because it is too large. Use 8, leaving 5; use 4, leaving 1; skip 2; then use 1.
32 16 8 4 2 1
1 0 1 1 0 1
45 = 32 + 8 + 4 + 1
45 in decimal = 101101 in binary
For an eight-bit presentation, add two zeros on the left: 00101101. Leading zeros preserve this unsigned numerical value. They can still matter when a format requires a fixed width, just as a form may require every box to be filled.
Try 22 yourself. The selected values are 16, 4, and 2, making 10110. Adding them gives 22 again. Then try 19: 16 plus 2 plus 1 gives 10011. Writing the place values above each attempt is usually more reliable than memorizing a conversion chart.
Why width and signedness matter
Before converting unfamiliar data, ask how many bits belong to one value and whether negative numbers are allowed. In eight-bit unsigned notation, 11111111 means 255. In eight-bit two’s-complement notation, the same pattern means −1. Bits alone do not announce which interpretation the program intended.
For an eight-bit two’s-complement value with a leading 1, you can calculate its unsigned value and subtract 256. For example, 11110000 is 240 unsigned, so it represents −16 in that signed format. Do not apply that shortcut to every binary string: it depends on the width and representation being specified.
Also distinguish a written number from bytes stored in memory. A format may define the order of multiple bytes separately. If you are inspecting a file, follow its documented layout rather than reversing digits or grouping everything into arbitrary eight-bit chunks.
Three mistakes to avoid when practicing
Do not count the number of ones to get the answer. Both 1001 and 0011 contain two ones, but the first represents 9 and the second represents 3. Position changes the value. Likewise, do not drop a zero from the middle: 101 becomes 11 if you remove its middle zero, changing five into three.
Watch the available width when adding. Four unsigned bits can hold at most 15. Adding one requires a fifth bit: 1111 becomes 10000. If a program stores only four bits, its rules determine what happens to the extra bit. On paper, keep it instead of silently replacing the result with 0000. A width limit is part of the problem, not a reason to change the arithmetic.
How does binary become letters?
Text needs a mapping between characters and numbers. In ASCII, capital A has value 65, which can be written as 01000001 in an eight-bit byte. The ASCII table in RFC 20 documents the character assignments. That does not make every byte an ASCII letter: some values are controls, and other formats use different rules.
UTF-8 represents Unicode code points using one to four bytes. ASCII characters keep their familiar single-byte values, while many other characters need more bytes. The Unicode Consortium’s encoding FAQ explains these distinctions. A visible symbol can also involve multiple code points, so “one character equals one byte” is an unreliable rule.

Check your answer with a small program
Python can verify a conversion without sending data to an online translator. These examples use Python’s built-in conversion functions. The 2 tells int to interpret the string in base 2; the 0b prefix in bin’s result marks binary notation.
print(int("00101101", 2)) # 45
print(bin(45)) # 0b101101
print(format(45, "08b")) # 00101101
The practical habit is simple: establish the format, label the positions, calculate, then check. If you expect text but get nonsense, verify the encoding and byte boundaries before assuming the binary is damaged.
For offline practice, browse beginner computer science books on Amazon. Look for exercises on number systems and data representation; no special equipment is needed.

Leave a Reply