40 in Binary

Binary10 1000
Decimal
40
Binary
10 1000
Hexadecimal
28
Octal
50
Bits needed
6

40 = 101000₂

The decimal number 40 is 10 1000 in binary.

Step by step

  1. 40 ÷ 2 = 20 remainder 0
  2. 20 ÷ 2 = 10 remainder 0
  3. 10 ÷ 2 = 5 remainder 0
  4. 5 ÷ 2 = 2 remainder 1
  5. 2 ÷ 2 = 1 remainder 0
  6. 1 ÷ 2 = 0 remainder 1
  7. Read the remainders from bottom to top: 101000.

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

Details

Binary
10 1000
8-bit form
00101000
Hexadecimal
28
Octal
50
Bits needed
6
Number of 1 bits
2

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
181 0010
191 0011
201 0100
301 1110
311 1111
3210 0000
4010 1000
5011 0010
6011 1100

Related conversions

Frequently asked questions

What is 40 in binary?

101000.

How do you convert 40 to binary?

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

How many bits are needed for 40?

6 bits.

What is 40 in hexadecimal?

28.

Related tools