Code tool

Rotate a Binary String Left

Enter a 0/1 string and a left rotation count to move its leading bits to the end locally.

In-browser processingNo account requiredPrivacy details ↗

Use only 0 and 1. The count is reduced modulo the string length.

Use only 0 and 1. The count is reduced modulo the string length.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter a non-empty binary string containing only 0 and 1.
  2. Enter a non-negative integer rotation count.
  3. Rotate the string left and copy the result.

Modulo rotation

The rotation count is reduced modulo the string length, so a full-length rotation returns the original string.

Exact string width

The result preserves every bit, including leading zeroes, and is processed locally in your browser.

GOOD TO KNOW

Common questions

What if the count is larger than the string length?

It is reduced modulo the string length.

Are leading zeroes preserved?

Yes. The output has exactly the same length as the input.