5 in Binary
5 in binary is 101. It takes 3 bits to write, and as a full byte it is 00000101.
How to convert 5 to binary
Divide by 2, write down the remainder, and repeat with the quotient until it reaches 0. The remainders, read from the last row up to the first, spell out 101.
| Division | Quotient | Remainder |
|---|---|---|
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Check it the other way
To verify, read 101 left to right, giving each digit its place value and adding up the places that hold a 1.
| Bit | Place value | Contributes |
|---|---|---|
| 1 | 22 = 4 | 4 |
| 0 | 21 = 2 | 0 |
| 1 | 20 = 1 | 1 |
Adding the contributions: 4 + 0 + 1 = 5. The conversion checks out.
5 in every base
| Format | Value |
|---|---|
| Binary | 101 |
| Decimal | 5 |
| Hexadecimal | 5 |
| Octal | 5 |
| As a byte (8-bit) | 00000101 |
Worth knowing about 5
Five is the smallest number whose binary form, 101, is a palindrome that uses both digits: it reads the same forwards and backwards.
Convert another number
- Binary
- Hex
- Octal
Nearby numbers
Or browse the full table at numbers in binary.
FAQ
What is 5 in binary?
5 converts to 101 in binary. Every 1 in the pattern marks a power of two that is part of the total, and every 0 marks one that is skipped. Add the marked powers and the sum is exactly 5. Padded to a byte, it reads 00000101.
How many bits does 5 need?
101 is 3 bits long, so 5 needs 3 bits at minimum. The count grows by one whenever a number reaches the next power of two. Inside a byte, the leftover positions are filled with zeros, which is why 5 appears as 00000101 in most computer contexts.
What is 5 in hex?
5 written in base 16 is 5. Programmers lean on hex because each digit maps to exactly four bits, turning long binary strings into short codes. For completeness, 5 in octal is 5 and in binary it is 101. They all name the same quantity.