42 in Binary

42 in binary is 10 1010 (101010).

Result 101010.

Binary (base 2)10 1010

Step by step

  1. Divide by 2 repeatedly and write down the remainders:
    DivisionQuotientRemainder
    42 ÷ 2210
    21 ÷ 2101
    10 ÷ 250
    5 ÷ 221
    2 ÷ 210
    1 ÷ 201
  2. Read the remainders from bottom to top: 10 1010
binary (base 2)10 1010
octal (base 8)52
decimal (base 10)42
hexadecimal (base 16)2A
Bits needed6 bits (fits in 1 byte)
8-bit form0010 1010
16-bit form0000 0000 0010 1010
32-bit form0000 0000 0000 0000 0000 0000 0010 1010

Quick method for 42

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

42 in other forms

  • Place values: 32 + 8 + 2 = 42
  • Hex: 2A
  • Octal: 52
  • 6 bits — fits in one byte
  • 3 one-bits (odd parity)
  • Padded: 0010 1010
  • 16-bit: 0000 0000 0010 1010
  • One's complement (8-bit): 1101 0101
  • Between 25 = 32 and 26 = 64
  • −42 in 8-bit two's complement: 1101 0110
  • ASCII: “*” — ASCII table

Going back: binary to decimal.

More numbers in binary

All numbers 0–255 in binary

42 in binary: questions

What is 42 in binary?

101010.

What is 42 in hex?

2A.

How many bits is 42?

6.