Computer Science
Basic

Decimal to Binary

Convert a decimal number to binary by dividing by 2 and reading remainders.

Formula

N=repeated division by 2N = \text{repeated division by } 2

Variables

NDecimal number

Example

13 = 1101₂

Did You Know?

Repeatedly dividing by 2 and reading the remainders bottom-up converts any number to binary.