21 in Binary

21 in binary is 1 0101 (10101).

Result 10101.

Binary (base 2)1 0101

Step by step

  1. Divide by 2 repeatedly and write down the remainders:
    DivisionQuotientRemainder
    21 ÷ 2101
    10 ÷ 250
    5 ÷ 221
    2 ÷ 210
    1 ÷ 201
  2. Read the remainders from bottom to top: 1 0101
binary (base 2)1 0101
octal (base 8)25
decimal (base 10)21
hexadecimal (base 16)15
Bits needed5 bits (fits in 1 byte)
8-bit form0001 0101
16-bit form0000 0000 0001 0101
32-bit form0000 0000 0000 0000 0000 0000 0001 0101

Quick method for 21

Find the powers of 2 that add up to 21: 16 + 4 + 1. Put a 1 in those places and 0 elsewhere: 10101.

21 in other forms

  • Place values: 16 + 4 + 1 = 21
  • Hex: 15
  • Octal: 25
  • 5 bits — fits in one byte
  • 3 one-bits (odd parity)
  • Padded: 0001 0101
  • 16-bit: 0000 0000 0001 0101
  • One's complement (8-bit): 1110 1010
  • Between 24 = 16 and 25 = 32
  • −21 in 8-bit two's complement: 1110 1011
  • ASCII: NAK — ASCII table

Going back: binary to decimal.

More numbers in binary

All numbers 0–255 in binary

21 in binary: questions

What is 21 in binary?

10101.

What is 21 in hex?

15.

How many bits is 21?

5.