40 in Binary

40 in binary is 10 1000 (101000).

Result 101000.

Binary (base 2)10 1000

Step by step

  1. Divide by 2 repeatedly and write down the remainders:
    DivisionQuotientRemainder
    40 ÷ 2200
    20 ÷ 2100
    10 ÷ 250
    5 ÷ 221
    2 ÷ 210
    1 ÷ 201
  2. Read the remainders from bottom to top: 10 1000
binary (base 2)10 1000
octal (base 8)50
decimal (base 10)40
hexadecimal (base 16)28
Bits needed6 bits (fits in 1 byte)
8-bit form0010 1000
16-bit form0000 0000 0010 1000
32-bit form0000 0000 0000 0000 0000 0000 0010 1000

Quick method for 40

Find the powers of 2 that add up to 40: 32 + 8. Put a 1 in those places and 0 elsewhere: 101000.

40 in other forms

  • Place values: 32 + 8 = 40
  • Hex: 28
  • Octal: 50
  • 6 bits — fits in one byte
  • 2 one-bits (even parity)
  • Padded: 0010 1000
  • 16-bit: 0000 0000 0010 1000
  • One's complement (8-bit): 1101 0111
  • Between 25 = 32 and 26 = 64
  • −40 in 8-bit two's complement: 1101 1000
  • ASCII: “(” — ASCII table

Going back: binary to decimal.

More numbers in binary

All numbers 0–255 in binary

40 in binary: questions

What is 40 in binary?

101000.

What is 40 in hex?

28.

How many bits is 40?

6.