Left Shift Calculator - Bitwise Left Shift (<<) Online
Result
—
Left Shift Calculator
The Left Shift Calculator performs a bitwise left shift operation on a binary or decimal number. Enter a number and the number of positions to shift, and instantly see the result. This free online tool is ideal for programmers, digital electronics engineers, computer science students, and embedded systems developers.
Left shift is one of the most efficient operations in programming — shifting a number left by N positions multiplies it by 2ᴺ, and is used extensively in fast multiplication, bit manipulation, and low-level data processing.
What is a Left Shift?
A left shift (logical left shift) is a bitwise operation that moves every bit of a number N positions to the left. Bits shifted off the left end (MSB side) are discarded, and zeros are inserted at the right end (LSB side). For unsigned integers, left shifting by N positions is equivalent to multiplying by 2ᴺ.
How to Perform Left Shift
- Write the binary representation of the number.
- Move all bits N positions to the left.
- Append N zeros to the right side of the number.
- The result is the left-shifted binary value.
Left Shift Formula
Result = Number × 2ᴺ In binary: append N zeros to the right Example: 0011 shift left 2 → 001100 = 12 (decimal)
Left Shift Examples
| Binary | Decimal | Shift Left By | Result Binary | Result Decimal |
|---|---|---|---|---|
| 0001 | 1 | 1 | 0010 | 2 |
| 0001 | 1 | 3 | 1000 | 8 |
| 0011 | 3 | 2 | 1100 | 12 |
| 0101 | 5 | 1 | 1010 | 10 |
| 1010 | 10 | 2 | 101000 | 40 |
Applications of Left Shift
- Fast Multiplication by Powers of 2
- Bit Field Packing and Manipulation
- Hash Function Computation
- Image Processing and Color Channels
- Embedded Systems Register Configuration
- Network Protocol Header Encoding
- Arithmetic in ALUs
Programming Examples
Python 3 << 2 Output 12
JavaScript 3 << 2 Output 12
C int result = 3 << 2; // result = 12
Frequently Asked Questions
What is a left shift operation?
A left shift moves all bits of a number N positions to the left, inserting zeros on the right. It is equivalent to multiplying the number by 2ᴺ.
What is 3 left shift 2 in binary?
3 (binary 0011) shifted left 2 positions gives binary 1100, which equals decimal 12.
What happens to bits that shift off the left end?
Bits that shift beyond the most significant bit (MSB) are discarded. This can cause overflow if the value exceeds the maximum for the data type.
What is the difference between left shift and right shift?
Left shift moves bits toward the MSB (higher positions), multiplying the value. Right shift moves bits toward the LSB (lower positions), dividing the value. Left shift inserts zeros on the right; right shift inserts zeros (or sign bit) on the left.
Is this Left Shift Calculator free?
Yes. This online Left Shift Calculator is completely free to use and works directly in your browser without any installation or registration.