Binary Bit Left-shifter
Perform binary left bit-shift operations on integers with arbitrary precision. View results in binary, decimal, hex, and octal formats.
About
A left bit-shift moves every bit in a binary number n positions toward the most significant side, filling vacated positions with 0. The operation is equivalent to multiplying the original value by 2n. Getting the shift count wrong by even 1 doubles or halves your intended result. In embedded firmware and network protocol work this causes silent data corruption that passes unit tests but fails in production. Standard JavaScript bitwise operators truncate operands to 32-bit signed integers, meaning any value above 231 − 1 overflows without warning. This tool uses arbitrary-precision arithmetic via BigInt, so you can shift a 256-bit cryptographic key left by 128 positions and still get the exact answer.
Results are displayed simultaneously in binary, decimal, hexadecimal, and octal. Bit-width markers flag when your result exceeds common register sizes (8, 16, 32, 64 bits). Note: this tool operates on unsigned magnitudes. For signed two's complement interpretation at a specific width, consult the reference table below for range limits.
Formulas
The left bit-shift operator takes an integer value and a non-negative shift count, producing a new integer whose binary representation is the original bits moved leftward with zeros inserted on the right.
Where value is the input integer (unsigned magnitude), n is the shift count (number of bit positions to shift left), and result is the output integer. The bit length of the result is computed as:
For a specific register width w, the masked result under unsigned interpretation is:
Overflow occurs when bitsresult > w. This tool does not truncate. It computes the full arbitrary-precision result and flags which standard widths would overflow.
Reference Data
| Bit Width | Unsigned Range | Signed Range (Two's Complement) | Max Left Shift from 1 | Common Use |
|---|---|---|---|---|
| 4 bits | 0 - 15 | −8 - 7 | 3 | Nibble, BCD digit |
| 8 bits | 0 - 255 | −128 - 127 | 7 | Byte, ASCII, I2C registers |
| 16 bits | 0 - 65,535 | −32,768 - 32,767 | 15 | short int, UTF-16 code unit |
| 32 bits | 0 - 4,294,967,295 | −2,147,483,648 - 2,147,483,647 | 31 | int32, IPv4 address, IEEE 754 float |
| 64 bits | 0 - 18,446,744,073,709,551,615 | −9.22 × 1018 - 9.22 × 1018 | 63 | long, pointer, timestamp (ns) |
| 128 bits | 0 - 3.40 × 1038 | −1.70 × 1038 - 1.70 × 1038 | 127 | UUID, IPv6 address, AES block |
| 256 bits | 0 - 1.16 × 1077 | −5.79 × 1076 - 5.79 × 1076 | 255 | SHA-256 hash, secp256k1 private key |
| 512 bits | 0 - 1.34 × 10154 | - | 511 | SHA-512 hash |
| 1024 bits | 0 - 1.80 × 10308 | - | 1023 | RSA key (legacy) |
| 2048 bits | 0 - 3.23 × 10616 | - | 2047 | RSA key (standard) |
| Common Shift Equivalences | ||||
| << 1 | Multiply by 2 | |||
| << 2 | Multiply by 4 | |||
| << 3 | Multiply by 8 | |||
| << 4 | Multiply by 16 (shift one nibble) | |||
| << 8 | Multiply by 256 (shift one byte) | |||
| << 10 | Multiply by 1,024 (KiB boundary) | |||
| << 16 | Multiply by 65,536 (shift one word) | |||
| << 20 | Multiply by 1,048,576 (MiB boundary) | |||
| << 24 | Multiply by 16,777,216 (RGB channel shift) | |||
| << 32 | Multiply by 4,294,967,296 (shift one dword) | |||