126 in Binary

126 in binary is 111 1110 (1111110).

Result 1111110.

Binary (base 2)111 1110

Step by step

  1. Divide by 2 repeatedly and write down the remainders:
    DivisionQuotientRemainder
    126 ÷ 2630
    63 ÷ 2311
    31 ÷ 2151
    15 ÷ 271
    7 ÷ 231
    3 ÷ 211
    1 ÷ 201
  2. Read the remainders from bottom to top: 111 1110
binary (base 2)111 1110
octal (base 8)176
decimal (base 10)126
hexadecimal (base 16)7E
Bits needed7 bits (fits in 1 byte)
8-bit form0111 1110
16-bit form0000 0000 0111 1110
32-bit form0000 0000 0000 0000 0000 0000 0111 1110

Quick method for 126

Find the powers of 2 that add up to 126: 64 + 32 + 16 + 8 + 4 + 2. Put a 1 in those places and 0 elsewhere: 1111110.

126 in other forms

  • Place values: 64 + 32 + 16 + 8 + 4 + 2 = 126
  • Hex: 7E
  • Octal: 176
  • 7 bits — fits in one byte
  • 6 one-bits (even parity)
  • Padded: 0111 1110
  • 16-bit: 0000 0000 0111 1110
  • One's complement (8-bit): 1000 0001
  • Between 26 = 64 and 27 = 128
  • −126 in 8-bit two's complement: 1000 0010
  • ASCII: “~” — ASCII table

Going back: binary to decimal.

More numbers in binary

All numbers 0–255 in binary

126 in binary: questions

What is 126 in binary?

1111110.

What is 126 in hex?

7E.

How many bits is 126?

7.