Calculator
Decimal Value
Binary
Hexadecimal
Shift Bits
bits
Drag slider or enter value (0-31)
The zero-fill right shift (>>>) operator shifts bits to the right, discarding bits shifted off, and shifting in zeros from the left[citation:2][citation:6].
Results
Decimal
10
Binary
00001010
Hex
0x0A
Binary Visualization
Original (32-bit):
Shifted Result:
Zeros filled from left
The zero-fill right shift operator (>>>) shifts bits to the right, discards excess bits, and fills vacated left bits with zeros. Unlike the sign-propagating shift (>>), it always returns a non-negative number[citation:6].
Quick Actions
Operation History
Just now
42 >>> 2 = 10
00101010 → 00001010
Additional Tools
Quick Reference
- >>> Operator: Zero-fill right shift
- Always returns: Non-negative number
- Shift range: 0 to 31 bits
- Fills left with: Zeros (0)
-
JavaScript syntax:
a >>> b
A bit shift is an operation where bits are moved either left or right[citation:1]. Logical shifts lose bits shifted out of scope and shift in 0's on the other end[citation:1].
Understanding Zero-Fill Right Shift (>>>)
What is Zero-Fill Right Shift?
The zero-fill right shift operator (>>>), also known as the unsigned right shift operator, is a bitwise operator in JavaScript that shifts the bits of a number to the right by a specified number of positions. Unlike the sign-propagating right shift (>>), it always fills the leftmost bits with zeros, resulting in a non-negative number[citation:2][citation:6].
How It Works
When you perform a >>> b:
- The binary representation of
ais shiftedbpositions to the right - Bits shifted off the right end are discarded
- Zeros are shifted in from the left side
- The result is always interpreted as an unsigned 32-bit integer
Example:
-9 >>> 2 yields 1073741821 because the sign bit (which was 1 for negative -9) is replaced with zeros, making the result positive[citation:6].
Practical Applications
- Color manipulation: Extracting RGB components from color values
- Data encoding/decoding: Processing binary data formats
- Performance optimization: Fast division by powers of 2 for non-negative numbers
- Bitmask operations: Extracting specific bit fields from packed data
Comparison with Other Shift Operators
| Operator | Name | Fills with | Result Sign | Example (-9 >> 2) |
|---|---|---|---|---|
>>> |
Zero-fill right shift | Zeros (0) | Always positive | 1073741821 |
>> |
Sign-propagating right shift | Sign bit (0 or 1) | Same as input | -3 |
<< |
Left shift | Zeros (0) | Can change | -36 |
Tips for Using This Calculator
- Enter values in decimal, binary, or hexadecimal - they automatically sync
- Use the slider or input field to adjust shift amount
- Watch the binary visualization to see exactly how bits move
- Check the operation history to track your calculations
- Use examples to understand common use cases
SEO Note
This page is optimized for search engines with descriptive titles, unique content, and proper semantic structure[citation:4][citation:10]. The canonical link ensures proper indexing without duplicate content issues.