Writing a Byte (Decimal to Binary)
You can already read a byte. Now let's go the other way — turning an ordinary number into binary.
Swipe or tap Next for the next section
The Method: Divide by 2, Keep the Remainders
To convert a decimal number into binary, repeatedly divide it by 2. Each time, write down the remainder — it'll always be 0 or 1. Keep dividing the result until you reach 0. Then read the remainders from bottom to top. That's your binary number.
Grab a pencil and paper for this one — the examples below are much easier to follow if you work through them alongside us, not just read them.
Example 1: Converting 13
13 ÷ 2 = 6 remainder 1 6 ÷ 2 = 3 remainder 0 3 ÷ 2 = 1 remainder 1 1 ÷ 2 = 0 remainder 1
Reading the remainders bottom to top: 1101
Read remainders bottom to top ↑
= 1101 in binary
Check it: 8 + 4 + 0 + 1 = 13. ✓
Example 2: Converting 41
41 ÷ 2 = 20 remainder 1 20 ÷ 2 = 10 remainder 0 10 ÷ 2 = 5 remainder 0 5 ÷ 2 = 2 remainder 1 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1
Bottom to top: 101001
Read remainders bottom to top ↑
= 101001 in binary
Check it: 32 + 8 + 1 = 41. ✓
The Easiest Mistake to Make
It's tempting to read the remainders top-to-bottom, in the order you wrote them. Don't — binary is built the other way around. The last remainder you calculate is actually the first digit of your answer. This trips almost everyone up the first time.
Don't Forget to Pad
Your result won't always be 8 digits. 41 converts to 101001 — only 6 digits. To write it as a full byte, add zeros to the FRONT (the left side) until you have 8 digits: 00101001.
Padding on the wrong side changes the number completely. Adding zeros to the end instead would give you 10100100 — a totally different value. Always pad on the left.
✓ Correct
Zeros added on the left
✗ Incorrect
Zeros added on the right — wrong
Try It Yourself
Binary result
Practice
Can you convert decimal to binary like a pro? Ten numbers, one focused round. Let's find out.