Bit Shift Calculator

Your details

Choose the number system your input value is written in.
The integer to shift. Enter in the base selected above. For binary, hex, or octal the field still uses decimal digits internally; switch to decimal for those bases or type the number in decimal equivalents.
How many bit positions to shift left or right.
bits
Left shift multiplies by 2 per position. Logical right shift divides unsigned; arithmetic right shift preserves the sign bit for signed integers.
The register width. Results are masked to this many bits, and overflow bits are discarded.
Result (decimal)
52

Unsigned decimal value of the shifted result

Result (signed decimal)52
Result (binary)0011 0100
Result (hexadecimal)0x34
Result (octal)0o64
Input (binary)0000 1101
Bits shifted out00
Equivalent multiplicationx * 2^2 = x * 4
Result (unsigned)52
Result (signed)52

13 shifted left by 2 = 52 (unsigned), 52 (signed)

  • Left shift by 2 is equivalent to multiplying by 4. The result fits within 8 bits.
  • In 8-bit representation, the signed range is -128 to 127 and the unsigned range is 0 to 255.

Next stepBit shifts are the fastest way to multiply or divide by powers of 2 at the CPU level. They are also used to isolate or set individual bits using bitwise AND/OR masks.

= Powered by OnlyCalculators