Bit Shift Calculator

Shift a number's bits left or right and see the binary and decimal result instantly.

Bit Shift Calculator

Our Bit Shift Calculator moves a number's binary digits left or right by a chosen number of positions, filling vacated positions and discarding shifted-out bits — the same operation as the <<, >>, and >>> operators in most programming languages. Enter your number as decimal, binary, or octal, choose a bit width to represent it in, and see the result in every format.

What Is a Bit Shift?

A bit shift takes a number's binary representation and slides every bit a fixed number of places left or right. A left shift multiplies the number by a power of two. A right shift divides it by a power of two — but there are two ways to fill the bits vacated on the left: arithmetic shifts repeat the sign bit (preserving negative numbers correctly), while logical shifts always fill with zeros.

Bit Shift Rules

Left Shift: n << s = n × 2s
Right Shift (Arithmetic): n >> s = floor(n ÷ 2s)
Right Shift (Logical): treats n as unsigned; fills with zeros
All results wrap to the selected bit width, discarding bits shifted past either end.

Example Calculations (8-bit)

Left Shift: 10 << 2, Data Type: Decimal, Width: 8-bit

00001010 shifted left by 2 gives 00101000

✓ Result = 40 (10 × 22)

Right Shift (Arithmetic): −8 >> 1, Width: 8-bit

11111000 (−8) shifted right with sign-extension gives 11111100

✓ Result = −4 (signed), 252 (unsigned)

Right Shift (Logical): −8 >>> 1, Width: 8-bit

11111000 shifted right with zero-fill gives 01111100

✓ Result = 124 (both signed and unsigned, since the sign bit is now 0)

Binary Data Type: 1010 << 2, Width: 8-bit

Entering 1010 directly as binary is the same value as decimal 10

✓ Result Binary = 00101000, Decimal = 40, Octal = 50

Features of Our Bit Shift Calculator

✅ Accepts decimal, binary, or octal input
✅ Choose 4, 8, 12, 16-bit, or a custom bit width
✅ Supports left, arithmetic right, and logical right shifts
✅ Shows signed and unsigned decimal, binary, and octal results
✅ Works with negative numbers
✅ Free to use, no sign-up required

Who Can Use This Calculator?

Programmers – For debugging bitwise logic and low-level code
Students – For computer science and digital logic coursework
Embedded & Systems Engineers – For register and flag manipulation
Puzzle Solvers – For quick binary arithmetic checks

👉 Try our Bit Shift Calculator to shift any number's bits and see the result instantly.