How it works
A number base (radix) sets how many digits are used before carrying to the next place. Decimal uses 10 digits; binary uses 2 (0 and 1); hexadecimal uses 16 (0–9 then A–F). Bases above 10 continue with letters up to Z for base 36.
To convert, the number is first read into its value (each digit times the base raised to its position) then repeatedly divided by the target base, collecting remainders as the new digits. Big-integer math keeps very long numbers exact.
Formula
value = Σ dᵢ × base^i; to convert, divide by the new base repeatedly and read the remainders in reverse
Questions people ask
How do I convert decimal to binary by hand?
Divide by 2 repeatedly and write down the remainders, then read them bottom to top. 13 → 6 r1 → 3 r0 → 1 r1 → 0 r1, so 13 = 1101.
Why do programmers use hexadecimal?
Each hex digit represents exactly 4 bits, so a byte is always two hex digits (00–FF). It is far more compact than binary and easy to convert.
What does 0x mean before a number?
It is a prefix marking hexadecimal, as in 0xFF = 255. Similarly 0b marks binary and 0o marks octal. You can type these prefixes here.