21 in Binary
21 in binary is 1 0101 (10101).
Result 10101.
Binary (base 2)1 0101
Step by step
- Divide by 2 repeatedly and write down the remainders:
Division Quotient Remainder 21 ÷ 2 10 1 10 ÷ 2 5 0 5 ÷ 2 2 1 2 ÷ 2 1 0 1 ÷ 2 0 1 - Read the remainders from bottom to top: 1 0101
| binary (base 2) | 1 0101 |
|---|---|
| octal (base 8) | 25 |
| decimal (base 10) | 21 |
| hexadecimal (base 16) | 15 |
| Bits needed | 5 bits (fits in 1 byte) |
| 8-bit form | 0001 0101 |
| 16-bit form | 0000 0000 0001 0101 |
| 32-bit form | 0000 0000 0000 0000 0000 0000 0001 0101 |
Quick method for 21
Find the powers of 2 that add up to 21: 16 + 4 + 1. Put a 1 in those places and 0 elsewhere: 10101.
21 in other forms
- Place values: 16 + 4 + 1 = 21
- Hex: 15
- Octal: 25
- 5 bits — fits in one byte
- 3 one-bits (odd parity)
- Padded: 0001 0101
- 16-bit: 0000 0000 0001 0101
- One's complement (8-bit): 1110 1010
- Between 24 = 16 and 25 = 32
- −21 in 8-bit two's complement: 1110 1011
- ASCII: NAK — ASCII table
Going back: binary to decimal.
More numbers in binary
21 in binary: questions
What is 21 in binary?
10101.
What is 21 in hex?
15.
How many bits is 21?
5.