Number bases (also called radixes) define how many unique digit symbols are used in a positional numeral system — humans use base 10 (decimal, digits 0–9) almost exclusively for daily arithmetic, but computers operate internally in base 2 (binary, digits 0 and 1), programmers read memory addresses in base 16 (hexadecimal, digits 0–9 and A–F), and Unix file permissions are traditionally expressed in base 8 (octal). Converting between bases is fundamental to computer science, embedded programming, and digital electronics. The sections below cover why different bases exist and when each is used, how positional notation works identically across any base, and two's complement — the clever representation that lets computers handle negative integers with the same circuitry used for positive ones.

Why Binary, Octal, and Hex Persist

Computers operate in binary because digital circuits have exactly two stable states — voltage high (1) or low (0) — and every other data representation must map to this underlying binary layer. A transistor in silicon is either conducting or not; a magnetic domain points one way or the other; a cell in flash memory stores high or low charge. Binary representation is therefore not a design choice but a physical constraint of digital hardware.

Hexadecimal (base 16) persists because each hex digit represents exactly 4 binary digits, making hex a compact human-readable shorthand for binary: a byte (8 bits) takes only 2 hex digits (00–FF) instead of 8 binary digits (00000000–11111111). Memory addresses, color codes (#FF5733), MAC addresses, and hash values all use hex for readability. Octal (base 8) represents 3 binary digits per symbol and survives in Unix file permissions (rwxr-xr-x = 755) and some embedded systems. Base 10 is purely a human convenience stemming from having 10 fingers — computers don't use decimal internally and convert only for display to human users, introducing rounding errors (like 0.1 not being exactly representable in binary) that occasionally surprise programmers.

Positional Notation Across Any Base

Positional notation works identically across any base — each digit position represents a power of the base. In base 10, the number 5,273 means 5×10³ + 2×10² + 7×10¹ + 3×10⁰ = 5000 + 200 + 70 + 3. In base 2, the binary number 1101 means 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8 + 4 + 0 + 1 = 13 decimal. In base 16, the hex number 2AF means 2×16² + 10×16¹ + 15×16⁰ = 512 + 160 + 15 = 687 decimal.

This uniformity means the conversion algorithm is identical regardless of the bases involved: multiply each digit by its positional weight and sum the results to get decimal, then repeatedly divide by the target base and record remainders to convert decimal to any other base. The calculator automates this process while also supporting custom bases from 2 to 36 (using digits 0-9 followed by letters A-Z for higher-value digits). Base 36 is the maximum representable with standard alphanumeric characters and is occasionally used for compact encoding of large integers (URL shorteners, file identifiers) where 10-digit decimal numbers can be compressed into 6-digit base-36 representations.

Two's Complement for Signed Integers

Computers need a way to represent negative integers efficiently, and two's complement is the universal modern solution used in virtually every CPU manufactured since the 1970s. In n-bit two's complement, the most significant bit represents -2^(n-1) while remaining bits represent positive values. For 8-bit two's complement: the value 00000001 is +1, 01111111 is +127 (maximum), 10000000 is -128 (minimum), and 11111111 is -1. The range for n-bit signed integers is -2^(n-1) to +2^(n-1)-1, which is asymmetric because zero takes one of the positive codes.

Two's complement has a critical practical advantage: addition and subtraction work identically to unsigned arithmetic with no special case for negative numbers, so hardware needs only one adder circuit for both signed and unsigned operations. To negate a number, invert all bits and add 1 — that's it. The alternative representations (sign-magnitude, one's complement) fell out of favor because they require separate hardware logic for signed operations or have two representations of zero (+0 and -0), both of which add complexity without benefit. The calculator shows two's complement representation for any integer value at widths of 8, 16, 32, or 64 bits, which is especially useful when debugging embedded code or decoding binary file formats where signed values are common.