127 in Binary

Binary111 1111
Decimal
127
Binary
111 1111
Hexadecimal
7F
Octal
177
Bits needed
7

127 = 1111111₂

The decimal number 127 is 111 1111 in binary.

Step by step

  1. 127 ÷ 2 = 63 remainder 1
  2. 63 ÷ 2 = 31 remainder 1
  3. 31 ÷ 2 = 15 remainder 1
  4. 15 ÷ 2 = 7 remainder 1
  5. 7 ÷ 2 = 3 remainder 1
  6. 3 ÷ 2 = 1 remainder 1
  7. 1 ÷ 2 = 0 remainder 1
  8. Read the remainders from bottom to top: 1111111.

Check the answer by adding the place values: 1×64 + 1×32 + 1×16 + 1×8 + 1×4 + 1×2 + 1×1 = 127. Each 1 bit adds its power of two and each 0 bit adds nothing.

Details

Binary
111 1111
8-bit form
01111111
Hexadecimal
7F
Octal
177
Bits needed
7
Number of 1 bits
7

How it works

Binary is base 2: each digit is a bit worth a power of two (1, 2, 4, 8, 16, 32 …). To convert a decimal number to binary, divide it by 2 again and again, writing down each remainder (0 or 1), until the quotient reaches 0. The binary number is the remainders read from the last one to the first. To check, add the powers of two where the bits are 1.

Nearby values

DecimalBinary
5011 0010
6011 1100
6311 1111
64100 0000
100110 0100
127111 1111
1281000 0000
1501001 0110
2001100 1000

Related conversions

Frequently asked questions

What is 127 in binary?

1111111.

How do you convert 127 to binary?

Divide by 2 repeatedly and read the remainders from bottom to top.

How many bits are needed for 127?

7 bits.

What is 127 in hexadecimal?

7F.

Related tools