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.

What do I need to know about 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.

What do I need to know about 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.

What's the key thing to understand about 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.

Worked Example: Converting a Decimal Number to Binary and Hexadecimal

Convert the decimal number 202 into both binary and hexadecimal. For binary, repeatedly subtract the largest power of 2 that fits: 202 = 128 + 64 + 8 + 2 (checking: 128 + 64 = 192, +8 = 200, +2 = 202). Writing a 1 in each position used and 0 elsewhere (bit positions 128, 64, 32, 16, 8, 4, 2, 1) gives binary 11001010. For hexadecimal, divide repeatedly by 16: 202 ÷ 16 = 12 remainder 10. The quotient 12 becomes the hex digit C, and the remainder 10 becomes the hex digit A, read in order to give CA, written as 0xCA. Checking: 12 × 16 + 10 = 192 + 10 = 202, confirming the conversion.

Reference Table: Powers of Two and Common Byte-Related Values

Because computers store numbers in binary, certain powers of 2 show up constantly as natural size limits:

Power of 2Decimal ValueCommon Use
2⁰1smallest possible bit value
2⁴16one hexadecimal digit (nibble) covers values 0-15
2⁸256one byte covers values 0-255
2¹⁰1,024a kilobyte (binary definition)
2¹⁶65,536range of a 16-bit unsigned integer
2³²4,294,967,296range of a 32-bit unsigned integer

The jump from an 8-bit byte (256 values) to a 16-bit value (65,536 values) is itself 2⁸ = 256× larger, which illustrates why each additional bit doesn't just add a little more range — it doubles it, so adding just a handful of extra bits multiplies the number of representable values enormously.

Shortcut: Converting Binary to Hexadecimal by Grouping Bits

Because 16 is a power of 2 (2⁴), binary and hexadecimal convert to each other without ever going through decimal at all — just by grouping binary digits into sets of four, starting from the right. Take the binary number 11001010 (equal to decimal 202, from the earlier conversion example). Splitting into 4-bit groups gives 1100 and 1010. The group 1100 equals 12 in decimal, which is the hex digit C. The group 1010 equals 10 in decimal, which is the hex digit A. Reading the groups left to right gives hexadecimal CA — matching the earlier decimal-based conversion exactly, but reached in far fewer steps, which is why programmers almost always convert binary to hex by grouping bits rather than by converting through decimal.

Octal: A Third Common Base in Computing

Octal (base 8) was widely used in early computing before hexadecimal became dominant, and it still appears today in contexts like Unix file permission codes (e.g., chmod 755). Converting decimal 202 to octal follows the same repeated-division method used for binary and hex, but dividing by 8 instead: 202 ÷ 8 = 25 remainder 2; 25 ÷ 8 = 3 remainder 1; 3 ÷ 8 = 0 remainder 3. Reading the remainders bottom to top gives octal 312. Checking: 3×64 + 1×8 + 2×1 = 192 + 8 + 2 = 202, confirming the conversion.

Binary, Decimal & Hex Converter

Results update automatically as you type

Enter values above to calculate