Use this right arithmetic shift calculator to shift bits right while preserving the sign bit. This operation effectively divides by powers of 2 while keeping negative numbers negative.
Right arithmetic shift calculator
Using the calculator
Enter the number to shift and select an input format: Decimal, Hex, Binary, or Octal. You can also type prefixes directly (0xFF for hex, 0b1010 for binary, or 0o17 for octal) and the tool will auto-detect the format. The positions field is always in decimal.
The result displays in all formats simultaneously: decimal (signed and unsigned), hexadecimal, octal, and a 32-bit binary representation with spaces every 8 bits for readability.
How right arithmetic shift works
Right arithmetic shift (>>) moves all bits to the right by a specified number of positions. The key difference from logical shift: it preserves the sign bit. The leftmost bit (sign bit) is copied into the vacated positions, so negative numbers stay negative.
Each position shifted right effectively divides the number by 2, rounding toward negative infinity:
x \gg n = \lfloor x \div 2^n \rfloor
Right arithmetic shift examples
Positive number
44 \gg 2 = 11
Shifting 44 right by 2 positions divides it by 4 (2²). In binary:
00101100 → 00001011
Negative number
-44 \gg 2 = -11
For negative numbers, the sign is preserved. The leftmost 1s (indicating negative in two's complement) are maintained as the bits shift right. This is the key difference from right logical shift, which would fill with 0s and produce a large positive number.
