4 in Binary
4 in binary is 100. It takes 3 bits to write, and as a full byte it is 00000100.
How to convert 4 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 100.
| Division | Quotient | Remainder |
|---|---|---|
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Check it the other way
To verify, read 100 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 |
| 0 | 20 = 1 | 0 |
Adding the contributions: 4 + 0 + 0 = 4. The conversion checks out.
4 in every base
| Format | Value |
|---|---|
| Binary | 100 |
| Decimal | 4 |
| Hexadecimal | 4 |
| Octal | 4 |
| As a byte (8-bit) | 00000100 |
Worth knowing about 4
Four is a perfect square of the base, so its binary form 100 mirrors what 100 means in decimal: the base multiplied by itself.
Convert another number
- Binary
- Hex
- Octal
Nearby numbers
Or browse the full table at numbers in binary.
FAQ
What is 4 in binary?
In binary, 4 is written 100. That is 3 digits, each one a power of two: the pattern says which of 1, 2, 4, 8, and so on to add together to make 4. Computers store it as the byte 00000100, padding the front with zeros.
How many bits does 4 need?
It takes 3 bits to write 4 in binary, since 100 has 3 digits and dropping any of them would change the value. Real hardware rounds up to whole bytes, so 4 normally sits in eight bits as 00000100, with the unused positions set to zero.
What is 4 in hex?
In hex, 4 is written 4. Because 16 is a power of two, hex lines up neatly with binary: one hex digit always covers four bits, so 100 compresses cleanly. The octal form, common in file permissions, is 4. Same number, three different notations.