Use this left shift calculator to shift bits left and multiply by powers of 2. Each position shifted left doubles the number.
Left logical shift calculator
Using the calculator
Enter the number to shift and select an input format: Decimal, Hex, Binary, or Octal. You can also type prefixes directly (0xFF for hex, 0b1010 for binary, or 0o17 for octal) and the tool will auto-detect the format. The positions field is always in decimal.
The result displays in all formats simultaneously: decimal (signed and unsigned), hexadecimal, octal, and a 32-bit binary representation with spaces every 8 bits for readability.
How left shift works
Left shift (<<) moves all bits to the left by a specified number of positions, filling the rightmost positions with zeros. Each shift left effectively multiplies the number by 2:
x \ll n = x \times 2^n
Unlike right shift, there is no "logical" vs "arithmetic" distinction for left shift - both operations are identical. Zeros always fill in from the right.
Left shift examples
44 \ll 2 = 176
Shifting 44 left by 2 positions multiplies it by 4 (2²). In binary:
00101100 → 10110000
1 \ll 10 = 1024
Left shifting 1 by n positions gives you 2n. This is a fast way to calculate powers of 2 in programming.
Common uses for left shift
Left shift is commonly used for:
- Fast multiplication by powers of 2
- Creating bit masks -
1 << ncreates a mask with only bit n set - Packing values - combining RGB:
(red << 16) | (green << 8) | blue
