To convert decimal to binary, repeatedly divide by 2 and track the remainders. The remainders, read in reverse, give you the binary representation.
Example: Convert to binary. remainder . remainder . remainder . remainder . Reading remainders bottom-up: .
Why does this work? Each division by 2 extracts the least significant bit (rightmost digit). Dividing again extracts the next bit. You are peeling off bits from right to left, which is why you reverse the remainders.