Right Logical Shift Calculator

Written by:
PK

Use this right logical shift calculator to shift bits right and fill with zeros. Unlike arithmetic shift, this operation does not preserve the sign bit.

Right logical 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 logical shift works

Right logical shift (>>>) moves all bits to the right by a specified number of positions, always filling the leftmost positions with zeros. This is also called an "unsigned" or "zero-fill" right shift.

The key difference from arithmetic shift: logical shift does not preserve the sign bit. This means negative numbers become large positive numbers after shifting.

Right logical shift examples

Positive number

44 \ggg 2 = 11

For positive numbers, logical and arithmetic shifts produce the same result. Shifting 44 right by 2 positions divides by 4.

Negative number

-44 \ggg 2 = 1073741813

Here is where logical shift differs dramatically. The negative number -44 in two's complement is:

11111111111111111111111111010100

Shifting right and filling with zeros gives:

00111111111111111111111111110101

Which is the large positive number 1,073,741,813.

When to use logical vs arithmetic shift

Use logical shift (>>>) when treating numbers as unsigned bit patterns - common in graphics, cryptography, and low-level byte manipulation. Use arithmetic shift (>>) when you want division by powers of 2 that preserves sign.

Related calculators

      

PK

PK started DQYDJ in 2009 to research and discuss finance and investing and help answer financial questions. He's expanded DQYDJ to build visualizations, calculators, and interactive tools.

PK lives in New Hampshire with his wife, kids, and dog.

Don't Quit Your Day Job...

DQYDJ may be compensated by our partners if you make purchases through links. See our disclosures page. As an Amazon Associate we earn from qualifying purchases.
Sign Up For Emails
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram