Bit Shift Calculator

Shift an integer's bits left or right.

Result (decimal) 20
Result (binary) 10100

Formula: left shift ×2ⁿ, right shift ÷2ⁿ

Step-by-step with your numbers:
1. Values used:
2. Value (decimal) = 5
3. Shift amount = 2
4.
5. Result (decimal) = 20
6. Result (binary) = 10100
Did we solve your problem today?

Shifting bits left or right is a fast way to multiply or divide by powers of two.

The math behind it

A left shift by n multiplies by 2ⁿ; a right shift by n divides by 2ⁿ (discarding remainder bits).

Worked example

5 (101) << 2 = 20 (10100).

FAQ

Why use bit shifts?

They are much faster than multiplication or division on most processors.