Math & Number Utilities100% Client-Side

Rotate Bits Left or Right

Paste a binary value, choose a direction, and set how many positions to rotate. Bits that move beyond one end appear at the other end. For example, a left rotation moves the first bits to the end, while a right rotation moves the last bits to the front. This is useful for comparing circular shifts at the same bit width without deleting any positions.

Configuration Options
Input
4 chars•1 lines
Output

How to Use the Rotate Binary Bits Left or Right Online

  1. 1Paste one unsigned binary value and keep the leading zeroes that are part of its field.
  2. 2Use only binary digits in the magnitude, with an optional 0b prefix and single underscores between digit groups.
  3. 3Choose the number of Steps and check the direction used by the page.
  4. 4Copy the complete bit string, including any leading zeroes. Record the input width alongside its expected result.

Input & Output Examples

Select Left and one step to move the first one to the end.

Input Sample
1001
Expected Output
0011

Select Right and two steps to move the final pair of zeroes to the front.

Input Sample
101100
Expected Output
001011

Practical Developer Workflows

  • Compare left and right rotations using one source pattern.
  • Check how the same step count behaves at several bit widths.
  • Prepare circular-shift fixtures that keep any leading and trailing zeroes.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

Rotation wraps outgoing bits back into the field. No bits are replaced with new zeroes. A logical shift can discard positions and fill the newly opened positions differently, so check the operation named by your fixture.

Explore Other Tools

12 suggested tools

View all tools