Circularly Shift a Binary Number
Enter a binary bit string, choose a direction and shift count, and rotate its bits locally without signed arithmetic.
A QUICK WALKTHROUGH
How to use this tool
- Enter 1–10,000 bits containing only 0 and 1.
- Choose left or right and enter a non-negative shift count.
- Shift the bits and copy the result with its original width.
Fixed-width bit strings
The output always has exactly the input width, including leading zeroes.
Modulo shift counts
The count is reduced modulo the bit width, so a full-width shift returns the original string.
String-based arithmetic
Bits are rotated as characters. The tool never parses a signed integer or applies two’s-complement rules.
GOOD TO KNOW
Common questions
Are leading zeroes preserved?
Yes. The result keeps the exact number of input bits.
What happens when the count is larger than the width?
It is reduced modulo the width.
Does this use signed arithmetic?
No. It operates on the bit string locally in your browser.