Decimal to Binary

Convert decimal numbers to binary.

Every number your computer has ever processed, at the deepest hardware level, exists as a string of 0s and 1s. This tool converts an ordinary decimal number into that binary representation, translating human arithmetic into the language transistors actually understand.

Why computers count in two, not ten

Humans almost certainly settled on base-10 because we have ten fingers — a biological accident of counting history, not a mathematical necessity. Computers, by contrast, are built from transistors that are most reliably built as simple two-state switches: on or off, high voltage or low voltage. Binary (base-2) maps perfectly onto this physical reality, which is why every digital computer since the earliest electronic designs of the 1930s and 40s — building on binary logic formalized by George Boole in the 1850s and applied to circuit design by Claude Shannon in his influential 1937 master's thesis — has used binary as its fundamental counting system, even though nearly everything humans do with those computers happens in decimal on the surface.

How the conversion works

The tool repeatedly divides your decimal number by 2, recording the remainder (0 or 1) at each step, until the number reaches zero — reading those remainders in reverse order produces the binary representation. This is the same "divide and track remainders" algorithm taught in introductory computer science courses, just executed instantly rather than by hand.

Where binary conversion is genuinely useful

  • Computer science education — understanding binary is foundational to understanding how computers actually store and process every kind of data, from numbers to text to images.
  • Low-level programming and embedded systems — working directly with hardware registers, bitwise operations or network protocols frequently requires reading and writing binary values directly.
  • Networking — IP address subnetting calculations are fundamentally binary operations, and understanding a subnet mask requires being able to convert between decimal and binary representations.
  • Digital logic and electronics — designing or debugging circuits, from simple logic gates to more complex digital systems, requires thinking natively in binary.

Frequently asked questions

Why does binary need so many more digits than decimal for the same number? Because each binary digit can only represent two states versus decimal's ten, binary needs roughly 3.3 times as many digits to represent the same value — the number 100 in decimal is 1100100 in binary, seven digits instead of three.

Is binary the same as "machine code"? Related but not identical — machine code is the actual set of binary-encoded instructions a specific processor executes, while "binary" more broadly just refers to base-2 number representation used for any kind of data, not only executable instructions.

Do negative numbers work differently in binary? Yes — computers typically represent negative integers using a scheme called two's complement rather than simply prefixing a minus sign, a system chosen specifically because it lets addition and subtraction circuits work identically regardless of a number's sign.

Further reading