Why Different Bases?

Number systems use different bases for different reasons, and each suits a particular kind of work. Decimal (base 10) — the everyday system — uses ten digits (0-9), almost certainly because humans have ten fingers; each position represents a power of ten (units, tens, hundreds, thousands, ...). Binary (base 2) uses just two digits (0 and 1), which maps perfectly onto digital electronics: a transistor or memory cell is either off (0) or on (1), so binary is the native language of every computer. Hexadecimal (base 16) uses sixteen 'digits' — 0-9 plus A-F (where A=10, B=11, ..., F=15); each hex digit represents exactly 4 binary digits (4 bits, often called a 'nibble'), which makes hex a far more compact way to write long binary strings. A byte (8 bits) is exactly two hex digits, so the byte 11010110 becomes D6 in hex — much easier to read and remember. Octal (base 8) appears occasionally in older systems and Unix file permissions, where each octal digit represents 3 bits. The choice of base doesn't change what number you're representing — 11, B, and 1011 all denote the same quantity — just how you write it down. Different bases are tools for different purposes: decimal for people, binary for hardware, hex for human-readable representations of binary data.

Binary to Decimal

Converting between binary and decimal relies on understanding what each digit position represents. In binary, positions from right to left are powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, .... Worked example: 1011₂ converts to decimal as 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀. You just multiply each binary digit by its position value and sum. Going the other way — decimal to binary — uses the 'repeated division' method: divide by 2 and record the remainder (0 or 1), then divide the quotient by 2 again, and so on until you reach 0. The binary number is the remainders read from bottom to top. Converting 13 to binary: 13÷2=6 r 1; 6÷2=3 r 0; 3÷2=1 r 1; 1÷2=0 r 1. Reading the remainders bottom-up: 1101₂. Check: 8+4+0+1 = 13 ✓. For converting between binary and hex, the conversion is much simpler because 16 is a power of 2: just group the binary digits into chunks of 4 from the right, and convert each chunk to its hex digit. 11010110 = 1101 0110 = D 6 = D6₁₆. Going from hex to binary is the reverse — each hex digit becomes 4 binary digits. These shortcuts make binary-hex work much faster than going through decimal.

Hexadecimal in Computing

Hex is everywhere in computing precisely because it's a compact human-readable form of binary. Memory addresses are written in hex (0x7FFF refers to a specific memory location — the '0x' prefix marks it as hex in many programming languages); a 32-bit address has 8 hex digits. Web and graphics colour codes use hex: #FF5733 means red=FF (255), green=57 (87), blue=33 (51) — three pairs of hex digits, one byte per channel. #000000 is black (no light), #FFFFFF is white (full red, green, blue), and any colour in between is just three bytes. MAC addresses (the unique identifiers on network cards) use six pairs of hex digits separated by colons, like AA:BB:CC:DD:EE:FF — six bytes, twelve hex digits. IP addresses in IPv6 also use hex, in eight groups of four hex digits. Error codes and debug output often appear in hex (a 'NullPointerException' might reference memory address 0x0). File-format magic numbers (the first few bytes that identify a file type) are usually quoted in hex: a PNG file starts with 89 50 4E 47, a PDF with 25 50 44 46 ('%PDF' in ASCII). Why hex rather than just decimal? Because each hex digit cleanly represents 4 bits, hex shows the underlying binary structure clearly — you can tell at a glance which bits are set without doing decimal arithmetic. For anyone working in software, hardware, networking, or web development, hex literacy is essential. This calculator converts between all four bases (binary, octal, decimal, hex) so you can see the same number in any form.

Exam Tips and Common Errors

A few habits avoid common conversion mistakes. First, always check which way you're converting — the methods for decimal-to-binary (repeated division) and binary-to-decimal (positional values) are different, and confusing them gives nonsense. Second, watch the direction when reading remainders in repeated division: bottom-up, not top-down — going the wrong way reverses the binary number. Third, double-check by converting back: any conversion can be verified by reversing it and checking you get the original number. Fourth, for binary-hex, count carefully when grouping into 4s — pad the left end with leading zeros if the binary number doesn't have a multiple of 4 digits (so 10110 becomes 00010110, then groups to 16₁₆). Fifth, remember hex digits A-F can be uppercase or lowercase (FF = ff); be consistent within a context. Sixth, when computers store numbers, they use a fixed number of bits (8, 16, 32, 64), and negative numbers use 'two's complement' representation — 8-bit signed numbers range from −128 to +127, with the leftmost bit acting as a sign indicator. This calculator handles unsigned positive integers across bases; signed-integer conversion is a separate, more involved topic. Seventh, sanity-check magnitude: an 8-bit value can't exceed 255, a 16-bit value 65,535, a 32-bit value about 4.3 billion — answers outside these ranges signal an error if you're working in a fixed-width context. Practice on small examples until the patterns feel natural; the maths is straightforward once the positional value of each digit becomes second nature.

Binary, Decimal & Hex Converter

Results update automatically as you type

Enter values above to calculate