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