Fibonacci sequence generator
Instantly generate the first terms of the Fibonacci sequence, where each number is the sum of the two previous ones. The calculation uses exact big integers, with no rounding, even beyond several hundred terms — all locally, in your browser.
How it works
The Fibonacci sequence appears both in recreational mathematics and in biology (the arrangement of sunflower seeds) or in algorithmics (classic recursion exercises). Each term is simply the sum of the two preceding terms: this tool calculates that sum iteratively to avoid the exponential computation times of a naive recursive implementation.
Why use "BigInt" instead of regular numbers?
The Fibonacci sequence grows very quickly: the 100th term already exceeds 21 digits, far beyond the exact precision of regular JavaScript floating-point numbers. This tool uses the BigInt type to ensure an exact result, digit by digit, no matter how many terms are requested.
What's the difference between the two starting points offered?
The modern mathematical convention starts the sequence at 0 (0, 1, 1, 2, 3, 5…), while Fibonacci's historical version (the rabbit problem) starts at 1 (1, 1, 2, 3, 5…). Both variants then produce exactly the same progression, shifted by one term.
All calculation runs locally in your browser in JavaScript — no data is sent to a server.