Binary is base 2, so each position is worth twice the one to its right: 1, 2, 4, 8, 16, 32 and so on. Converting a decimal number to binary means repeatedly subtracting the largest power of two that fits, writing a 1 in that place and a 0 everywhere it does not.
Take 45. The largest power of two below it is 32, leaving 13. Next comes 8, leaving 5, then 4, leaving 1, then 1. Place values 32, 8, 4 and 1 are set and the rest are zero: 101101. Read right to left, the positions are 1, 2, 4, 8, 16, 32 — a fact worth memorising, since it makes most conversions a few seconds of mental arithmetic.
Going the other way is faster. For 11010, mark the position values from the right: 0×1, 1×2, 0×4, 1×8, 1×16. Add them: 2 + 8 + 16 = 26. Anyone who works with IP addresses, subnet masks or embedded registers does this routinely, and the ability to do it without a tool is genuinely useful in a debugging session.
Convert instantly between binary, decimal and hexadecimal. Enter a value in any base and the other two update right away — useful for programming, networking and study.
Frequently Asked Questions
How do I convert 100 in decimal to binary?
100 = 64 + 32 + 4, so the bits at 64, 32 and 4 are set: 1100100. Eight-bit representation pads it to 01100100.
What is the largest number an 8-bit binary value can hold?
255, which is 11111111. A 16-bit value reaches 65,535 and a 32-bit value reaches about 4.29 billion.
How are negative numbers stored in binary?
Most systems use two's complement: invert every bit of the positive value and add one. In 8-bit terms, −5 becomes 11111011.
Why do programmers still care about binary?
Bit flags, colour channels, file permissions, subnet masks and hardware registers are all binary in design. Reading them in their native form is often faster than converting.