Binary shift calculator
Logical shift left
0101 1000
22 × 4 = 88.
- Before
- 0001 0110 (22)
- After
- 0101 1000 (88)
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 |
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 |
Working
- Move every bit 2 places to the left: 0001 0110 becomes 0101 1000.
- Fill the 2 empty places on the right with 0s. The bits pushed off the left (00) are lost.
- Each place left doubles the value, so this multiplies by 2² = 4: 22 × 4 = 88.
Your result
0101 1000. 22 × 4 = 88.
Practise binary shifts
Your mock plan, in three taps
A left shift of 2 places multiplies by 4: 0001 0110 (22) becomes 0101 1000 (88). A right shift divides by 2 for each place.
Questions people ask
How does a left shift multiply?
Each place left doubles every bit's place value, so a shift of 1 multiplies by 2, 2 places by 4 and 3 places by 8. 0001 0110 (22) shifted 2 left is 0101 1000 (88).
What happens when a 1 falls off the end?
Its value is lost. On a left shift the answer is then no longer an exact multiple (an overflow); on a right shift the answer is rounded down, so 0000 0111 (7) shifted 1 right is 0000 0011 (3).
What fills the gap after a shift?
In a logical shift, which is the only kind GCSE uses, the gap always fills with 0s, on the right after a left shift and on the left after a right shift.
More free tools
Keep going
How we work this out
What it does
Shift an 8-bit binary number left or right, see which bits are lost and what the shift does to its value.
Logical shifts of 1 to 7 places on numbers of up to 8 bits, as both GCSE boards set them.
Method
- Every bit moves the given number of places; the gap fills with 0s and bits pushed off the end are lost.
- Each place left multiplies by 2 and each place right divides by 2, as long as no 1 is lost.