31 in Binary

31 in binary is 1 1111 (11111).

Result 11111.

Binary (base 2)1 1111

Step by step

  1. Divide by 2 repeatedly and write down the remainders:
    DivisionQuotientRemainder
    31 ÷ 2151
    15 ÷ 271
    7 ÷ 231
    3 ÷ 211
    1 ÷ 201
  2. 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 needed5 bits (fits in 1 byte)
8-bit form0001 1111
16-bit form0000 0000 0001 1111
32-bit form0000 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

All numbers 0–255 in binary

31 in binary: questions

What is 31 in binary?

11111.

What is 31 in hex?

1F.

How many bits is 31?

5.