Bit Shift Calculator
Work out bit shift instantly with clear inputs, formula shown and shareable results.
About Bit Shift Calculator
Shifting left by k multiplies by 2ᵏ and shifting right divides by 2ᵏ, discarding any remainder. Shifts were historically much faster than multiply and divide instructions, and compilers still use them.
Formula
Bit shifts
v << k = v × 2ᵏ, v >> k = floor(v / 2ᵏ)
Worked example
With the default values below, Bit Shift Calculator returns Shifted value of 296. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Value
- 37
- Shift amountaccepts 0–31
- 3
- Directionone of Left (<<), Right (>>)
- Left (<<)
Results
- Shifted value
- 296
- Equivalent factor 2ᵏ
- 8
- Binary before
- 100101
- Binary after
- 100101000
Step by step
- 1Values used
- 2Bit shifts
- 3Shifted value= 296
- 4Equivalent factor 2ᵏ= 8
- 5Binary before= 100101
- 6Binary after= 100101000
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What is 37 << 3?
37 × 8 = 296. In binary 100101 becomes 100101000.
Is right shift the same as dividing?
For non-negative values yes, rounding toward zero. For negatives, arithmetic shift rounds toward negative infinity instead.
Related Calculators
You might also need
- Parity Bit CalculatorAlso in Discrete Math, Logic & Number Theory
- Discrete Logarithm CalculatorAlso in Discrete Math, Logic & Number Theory
- Adjacency Matrix CalculatorAlso in Discrete Math, Logic & Number Theory
- Base 64 Value CalculatorAlso in Discrete Math, Logic & Number Theory
- Bell Number CalculatorAlso in Discrete Math, Logic & Number Theory
- Binary To Decimal CalculatorAlso in Discrete Math, Logic & Number Theory
