Shift Binary Left
Move the bits of a binary value left by a number of positions.
What this page computes
Enter a binary value and a shift count, and the page moves every bit left by that many positions, appending one 0 per position, then prints the binary and the decimal value. A left shift multiplies by two raised to the count.
Where it stops
Values are BigInt, not 32-bit words, so a shift past bit 31 keeps the high bits instead of discarding them. A negative count is refused because it belongs on the right-shift page, and a count above 4096 is refused because the printed number would be over a thousand digits.
Why the answer repeats
The shift is integer arithmetic in this tab, so the same value and count always print the same bits and nothing is uploaded.
Left-shifts a binary value by a chosen number of positions using BigInt, printing the new binary and the decimal value. Negative counts and counts above 4096 are refused; nothing is truncated at 32 bits.
How to use it
Type the binary value and the shift count, then press Run. The first line is the shifted binary and the second the decimal.
The arithmetic
Each position multiplies the value by two, so shifting by n multiplies by 2^n and appends n zeros. BigInt is used because a bitwise shift on a JavaScript number would wrap at 32 bits.
What to Expect
Best for
- BigInt: no 32-bit truncation
- Decimal value printed beside the bits
- Count bounded at 4096
What this tool keeps
- the shifted bits and the decimal value
Sample input
1010 with a shift of 2
Sample output
1010 << 2 = 101000 Decimal = 40
Frequently asked questions
How do I use the shift binary left page?
Type the binary value and the shift count, then press Run.
Is anything uploaded?
No. The whole calculation runs in this tab with JavaScript: no request is made, no account is needed, nothing is stored, and the page keeps working offline once it has loaded.
What are its limits or bounds?
The count must be from 0 to 4096 and the value must contain only 0 and 1. A count above 4096 must be refused so the page never prints an unreadable wall of digits.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.