Built and fact-checked by the DocNectar team — see our editorial standards
Key Features
Instant Calculation
Get accurate results in real time with our optimized algorithm.
Mobile Friendly
Fully responsive design. Works on all devices & screen sizes.
Privacy Focused
Your data stays on your device. We don't store any inputs.
100% Free
No hidden costs. This tool is completely free forever.
A Linear Feedback Shift Register (LFSR) is a shift register — a row of bits that shifts one position at a time — whose new incoming bit is computed as a linear function (specifically, an XOR) of some of its own previous bits, rather than from any outside input. Despite being fully deterministic, an LFSR's output sequence looks statistically "random" over a long run and repeats only after a long period, which is why LFSRs are a workhorse building block in digital electronics and cryptography: generating pseudo-random bit sequences for testing, computing CRC (cyclic redundancy check) error-detection codes used in networking and storage, and forming the core of classic stream ciphers used in encryption.
How it works
Enter the seed as a bit string (the register's starting contents, read left to right), the tap positions (1-indexed counting from the left end of the register, comma-separated), and the number of steps to simulate. This tool models the "Fibonacci" LFSR configuration, the more common of the two standard LFSR layouts. At each step: the feedback bit is computed by XOR-ing together the bits currently sitting at every specified tap position; the bit at the rightmost end of the register is read off as that step's output bit; the entire register then shifts one position to the right, discarding that rightmost bit; and the newly-computed feedback bit is inserted at the now-empty leftmost position. Repeating this process for the requested number of steps produces the full output sequence, one bit per step.
- Enter seed (bit string).
- Enter tap positions, 1-indexed from the left (comma-separated).
- Enter number of steps to simulate.
- Click Calculate to see your results.
Examples
Seed = 1011, taps = 4,3, steps = 4
Register starts as [1,0,1,1]. Step 1: feedback = bit4 XOR bit3 = 1 XOR 1 = 0; output bit = bit4 = 1; register becomes [0,1,0,1]. Step 2: feedback = 1 XOR 0 = 1; output = 1; register becomes [1,0,1,0]. Step 3: feedback = 0 XOR 1 = 1; output = 0; register becomes [1,1,0,1]. Step 4: feedback = 1 XOR 0 = 1; output = 1; register becomes [1,1,1,0]. Final output sequence: 1101. Final register: 1110.
Seed = 101, taps = 3,1, steps = 3
Register starts as [1,0,1]. Step 1: feedback = bit3 XOR bit1 = 1 XOR 1 = 0; output = bit3 = 1; register becomes [0,1,0]. Step 2: feedback = 0 XOR 0 = 0; output = 0; register becomes [0,0,1]. Step 3: feedback = 1 XOR 0 = 1; output = 1; register becomes [1,0,0]. Final output sequence: 101. Final register: 100.
Who should use it
- Understanding how CRC checksums and pseudo-random bit generators work internally.
- Digital electronics and cryptography coursework on shift registers.
- Prototyping simple stream-cipher-style keystream generation for learning purposes.
Industry applications
- Digital electronics and hardware design
- Networking and data storage (CRC error detection)
- Cryptography education
Advantages
- Simple, fast, and fully deterministic — reproducible given the same seed and taps.
- A foundational building block for CRCs, pseudo-random generators, and classic stream ciphers.
Limitations
- Not cryptographically secure on its own, since the linear feedback rule is predictable given enough output bits.
- An all-zero seed produces a permanently stuck output.
Common mistakes to avoid
- Using a tap position greater than the seed's bit length, which doesn't correspond to any actual register position.
- Starting from an all-zero seed, which produces a permanently "stuck" register that only ever outputs zeros.
- Assuming the output is cryptographically secure on its own — a plain single LFSR's output can be predicted by an attacker who recovers enough consecutive output bits, since the feedback rule is linear and therefore solvable.
Best practices
- Avoid an all-zero seed, since it produces a permanently stuck, all-zero output.
- Double check tap positions are numbered from the left and don't exceed the register's bit length.
- Remember an LFSR alone is deterministic and not cryptographically secure — real stream ciphers add extra nonlinear complexity on top.
Tips
- Curious about modern, cryptographically-secure encryption instead? Look at the AES Encryption Tool.