Convert numbers between decimal, binary, hex and octal.
Decimal uses ten digits, binary uses two, octal uses eight and hexadecimal uses sixteen (0 to 9 and A to F). Programmers use them because binary matches how hardware stores data and hexadecimal is a compact way to write it.
The decimal number 255 is 11111111 in binary, 377 in octal and FF in hexadecimal. To check hexadecimal FF, calculate 15 ร 16 + 15 = 255.
To convert decimal to another base, divide repeatedly by the base and read the remainders from last to first. To convert back, multiply each digit by the base raised to its position and add.