How positional number bases work
A base, or radix, is the number of distinct digits a system uses. In base 10 each position is worth ten times the one to its right; in base 2 each is worth twice as much, so 1011 is 8 + 0 + 2 + 1 = 11. Hexadecimal, base 16, uses the digits 0–9 and then A–F for ten to fifteen. It is popular in computing because one hex digit is exactly four bits, so a byte is always two hex digits and a 32-bit value is eight: 0xDEADBEEF is far easier to read than its 32 binary digits. Octal, base 8, maps three bits per digit and survives in Unix file permissions such as chmod 755.
Converting between any two bases means reading the digits into a single integer and writing it back out in the target base. This tool does that with JavaScript's BigInt, so there is no upper limit and no rounding: a 256-bit hash, a 20-digit account number or 264−1 converts exactly. Regular JavaScript numbers lose precision above 253, which is why pasting a large ID into many converters silently changes its last digits.
Two's complement and fixed widths
Computers store integers in a fixed number of bits, and almost all of them represent negative numbers with two's complement: the most significant bit carries a negative weight. In 8 bits, 11111111 is 255 read as unsigned but −1 read as signed, and 10000000 is 128 or −128. The same bit pattern means different things depending on the type you read it as, which is the source of many overflow bugs. The bits panel shows both readings at the chosen width, flags values that do not fit, and lets you flip individual bits to see the effect, which is useful when working with flags, masks and hardware registers.
| Width | Unsigned range | Signed range | Common type |
| 8-bit | 0 to 255 | −128 to 127 | uint8 / int8, byte, char |
| 16-bit | 0 to 65,535 | −32,768 to 32,767 | uint16 / short, UTF-16 code unit |
| 32-bit | 0 to 4,294,967,295 | −2,147,483,648 to 2,147,483,647 | uint32 / int, IPv4 address, Unix time (signed) |
| 64-bit | 0 to 18,446,744,073,709,551,615 | ±9.22 × 1018 | uint64 / long, database BIGINT |
Byte order
A multi-byte value has to be laid out in memory in some order. Big-endian puts the most significant byte first, the way we write numbers; it is the network byte order used by TCP/IP headers and most file formats. Little-endian puts the least significant byte first, and is what x86 and ARM processors use in memory. The value 0x12345678 is stored as 12 34 56 78 big-endian and 78 56 34 12 little-endian. When a hex dump of a file or packet does not match the number you expected, reversing the byte order is the first thing to try; both layouts are shown side by side.
Floating point bits
At 32 and 64 bits the same pattern can also be read as an IEEE-754 floating-point number, the format used by float and double in nearly every language. The bits split into a sign, an exponent and a mantissa. The panel decodes them and reports whether the value is normal, subnormal, zero, infinity or NaN. Use the decimal-to-bits field to see why 0.1 cannot be stored exactly: its float64 pattern is 0x3FB999999999999A, a repeating binary fraction rounded at the last bit, which is why 0.1 + 0.2 is not exactly 0.3.