127 in Binary

127 in binary is 111 1111 (1111111).

Result 1111111.

Binary (base 2)111 1111

Step by step

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

Quick method for 127

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

127 in other forms

  • Place values: 64 + 32 + 16 + 8 + 4 + 2 + 1 = 127
  • Hex: 7F
  • Octal: 177
  • 7 bits — fits in one byte
  • 7 one-bits (odd parity)
  • Padded: 0111 1111
  • 16-bit: 0000 0000 0111 1111
  • One's complement (8-bit): 1000 0000
  • Between 26 = 64 and 27 = 128
  • −127 in 8-bit two's complement: 1000 0001
  • ASCII: DEL (delete) — ASCII table

Going back: binary to decimal.

More numbers in binary

All numbers 0–255 in binary

127 in binary: questions

What is 127 in binary?

1111111.

What is 127 in hex?

7F.

How many bits is 127?

7.