21 in Binary
Decimal 21 equals 10101 in binary.
21 in all number bases
Decimal21
Hexadecimal0x15
Binary0001 0101
Octal25
Try another value
Edit this value or switch its base. Your changes are calculated in your browser with exact integer arithmetic.
Input base:
Decimal
21Hex
0x15Binary
0b10101Octal
0o25How 21 converts from decimal to binary
Divide by 2 repeatedly and keep each remainder, then read the remainders from bottom to top:
21÷ 2 =10remainder1
10÷ 2 =5remainder0
5÷ 2 =2remainder1
2÷ 2 =1remainder0
1÷ 2 =0remainder1
Result (remainders bottom to top): 10101
This tool runs entirely in your browser - nothing you enter is uploaded or stored.