Skip to the tool

Binary shift calculator

Up to 8 bits

Direction

Logical shift left

0101 1000

22 × 4 = 88.

Before
0001 0110 (22)
After
0101 1000 (88)
Before: 22
1286432168421
00010110
After: 88
1286432168421
01011000

Working

  1. Move every bit 2 places to the left: 0001 0110 becomes 0101 1000.
  2. Fill the 2 empty places on the right with 0s. The bits pushed off the left (00) are lost.
  3. 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

GCSE Computer Science Pro

Full refund within 14 days

£49 once

12 months of access

By paying you agree to our Terms and get access straight away, which ends your 14-day cancellation right. Your full refund within 14 days, for any reason, still applies.

No VAT is charged. Terms

Your mock plan, in three taps

Your subject
When do your mocks start?
Hours a week

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.

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

  1. Every bit moves the given number of places; the gap fills with 0s and bits pushed off the end are lost.
  2. Each place left multiplies by 2 and each place right divides by 2, as long as no 1 is lost.