Fibonacci Generator
Generate the Fibonacci sequence up to any term.
The sequence starts 0, 1, 1, 2, 3, 5, … — each term is the sum of the two before it. Large terms are computed exactly with BigInt.
Last term generated (term 20)
4,181
Terms generated
20
Sum of the sequence
10,945
- 10
- 21
- 31
- 42
- 53
- 65
- 78
- 813
- 921
- 1034
- 1155
- 1289
- 13144
- 14233
- 15377
- 16610
- 17987
- 181,597
- 192,584
- 204,181
How to use Fibonacci Generator
What this calculator does
This tool generates the Fibonacci sequence — the famous series where every number is the sum of the two before it: 0, 1, 1, 2, 3, 5, 8, 13, 21, and so on. You can ask for the first N terms or for every term up to a maximum value. The generator returns the full sequence in a scrollable list, the last term it produced, the count of terms, and the running sum of everything generated. All of the larger numbers are computed with BigInt, so even term 500 is shown exactly rather than as a rounded approximation.
Why you might need it
The Fibonacci sequence turns up far more often than its simple definition suggests. Programmers use it as a classic exercise in recursion, iteration, and memoisation. Mathematics students study it alongside the golden ratio, since the ratio of consecutive terms converges on roughly 1.618. Designers and traders reference Fibonacci numbers in layout grids and retracement levels. Teachers use it to demonstrate how a tiny rule produces rapid, structured growth. Having the sequence generated instantly — with an exact sum and the nth term — saves you from writing throwaway code or making addition slips on long runs of large numbers.
How to use it
- Choose a mode. “First N terms” asks you for a count; “Up to a maximum value” asks you for a ceiling.
- Enter your number. In count mode this is how many terms you want, capped at 1000. In maximum-value mode it is the largest term the sequence may reach.
- Read the result: the last term generated appears in the headline card, with the term count and the sum shown beside it.
- Scroll the sequence list to see every term with its position, and use the copy buttons to copy a single value or the whole comma-separated list.
How it’s calculated
Each Fibonacci term is defined by the recurrence F(n) = F(n−1) + F(n−2), with the starting values F(1) = 0 and F(2) = 1. The generator computes the sequence iteratively rather than recursively: it keeps two running values, adds them to get the next term, and shifts the pair forward. This iterative approach takes linear time and avoids the exponential blow-up of naive recursion. Because Fibonacci numbers grow geometrically — roughly multiplying by the golden ratio 1.618 each step — they quickly exceed the range that ordinary numbers can store without rounding, so every term is held as a BigInt. The sum is accumulated as a BigInt total while the sequence is built, and the nth term is simply the last value produced. In maximum-value mode the loop stops as soon as the next term would exceed your ceiling.
Common pitfalls
The most common surprise is indexing. Because this tool starts at term 1 = 0, “the 10th Fibonacci number” here is 34, while a textbook that starts 1, 1 would call 34 the ninth. When comparing with another source, check which convention it uses. Another point of confusion is the sum: it is the total of every term actually generated, so it changes as you change N or the maximum. Finally, maximum-value mode stops at the last term that is less than or equal to your ceiling — it never produces a term that exceeds it.
Tips
To explore the golden ratio, generate a few dozen terms and divide each by the one before it; the quotient settles near 1.6180339887. If you need a specific high term, count mode is the direct route — set N to the index you want and read the headline card. Because everything is computed locally with exact BigInt arithmetic, you can experiment freely with large values, and nothing you type ever leaves your browser.
Frequently asked questions
Where does the Fibonacci sequence start?
Why are the large terms exact and not rounded?
What do the two modes do?
Why is there a cap on the number of terms?
Is anything I enter sent to a server?
Related tools
Prime Number Generator
Generate primes with the Sieve of Eratosthenes.
Factorial Calculator
Calculate factorials, even for very large numbers.
Prime Number Checker
Check whether a number is prime.
GCD & LCM Calculator
Find the GCD and LCM of multiple numbers.
Roman Numeral Converter
Convert between numbers and Roman numerals.
Permutation & Combination Calculator
Calculate permutations (nPr) and combinations (nCr).