What is the Fibonacci sequence?

The Fibonacci sequence is the list of numbers that starts 0, 1 and then continues by adding the previous two terms together: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 and so on forever. This page, and this fibonacci calculator, use the modern standard convention F(0) = 0 and F(1) = 1, catalogued as sequence A000045 in the On-Line Encyclopedia of Integer Sequences (OEIS). Every later term follows the same rule: F(2) = F(1) + F(0) = 1, F(3) = F(2) + F(1) = 2, F(4) = 3, F(5) = 5, and by the time you reach F(10) the answer is 55. The convention matters more than it first appears, because older books and some websites start the sequence 1, 1, 2, 3, 5 instead, which shifts every index by one place. Whenever you compare a result from this page with another fibonacci numbers list, check which starting pair that list uses before deciding that one of them is wrong.

The sequence is named after Leonardo of Pisa, known as Fibonacci, who described it in his 1202 book Liber Abaci as a model of an idealised rabbit population. It was known earlier in Indian mathematics, in work on poetic metres by scholars including Pingala and Hemachandra. That history is a useful reminder of what the sequence really is: not a mystical code, but the natural output of a very simple growth rule. A fibonacci sequence generator is worth having because the growth is deceptive: the terms crawl at first, then accelerate, passing a thousand at F(17) = 1,597 and reaching a 21-digit value by F(100).

How this fibonacci calculator works

Quick answer: Pick a mode, type your number, and read the exact result. Nth term mode uses fast doubling with BigInt arithmetic for any index from -10,000 to 10,000. The sequence generator builds the first N terms, or every term up to your value, by repeated exact addition.

The calculator offers the three jobs people actually ask a fibonacci calculator to do, plus a fourth that most tools leave out. Nth term mode answers the single most common question - what is the nth fibonacci number - for any index from -10,000 to 10,000, including negative indices. The sequence generator produces lists instead of single values: either the first N terms, for N from 1 to 500, or every term up to a value you supply, which is the natural way to answer questions such as which Fibonacci numbers are below 1,000. Negative indices are handled inside nth term mode by the negaFibonacci rule described below, not rejected as an error. And for moderate positive n, nth term mode also displays the golden ratio convergence: the value of F(n+1) / F(n) printed to 25 decimal places, so you can see it closing in on the golden ratio phi as n increases.

Exactness is the design rule throughout. Ordinary JavaScript numbers stop representing integers exactly after 2^53, which the sequence passes at F(79); a tool built on them would silently round F(100) and everything beyond it. This page performs all integer arithmetic with BigInt, so F(100) = 354,224,848,179,261,915,075 is digit-for-digit correct and so is the 2,090-digit F(10,000). The one deliberate exception is labelled: the ratio F(n+1) / F(n) is printed as a high-precision decimal for moderate n rather than as a 2,000-digit fraction. Nothing is uploaded: every mode runs locally in your browser tab.

The recurrence, fast doubling and Binet formula

The definition is the recurrence F(n) = F(n-1) + F(n-2), anchored by F(0) = 0 and F(1) = 1. Computing a large term by literally performing that recurrence means doing n additions, which is fine for F(50) and merely tedious for F(10,000), but the calculator uses a stronger method called fast doubling. It rests on two identities: F(2k) = F(k) x (2 F(k+1) - F(k)) and F(2k+1) = F(k+1)^2 + F(k)^2. Given the pair at position k, these formulas hand you the pair at position 2k or 2k+1 in a constant amount of work, so by reading the binary digits of n from the most significant end, the calculator reaches F(n) in about log2(n) steps - roughly fourteen steps for n = 10,000 instead of ten thousand additions. Each step is a handful of BigInt multiplications, which is why even the maximum index returns instantly.

The famous alternative is Binet formula, F(n) = (phi^n - psi^n) / sqrt(5), where phi is the golden ratio and psi = (1 - sqrt(5)) / 2. As pure mathematics it is exact, and because psi^n shrinks towards zero it also explains why F(n) is the nearest integer to phi^n / sqrt(5). As a computing method it is a trap: phi must be stored as a floating point approximation, and raising it to large powers magnifies the error until the integer part itself is wrong. This calculator therefore treats Binet formula as theory - the cleanest explanation of the golden ratio connection - but never uses it to produce a result.

What is the 100th Fibonacci number?
F(100) = 354,224,848,179,261,915,075 - a 21-digit number. Enter 100 in nth term mode above to reproduce it exactly, along with its digit count and the ratio F(101) / F(100).

Worked examples: F(10), F(50) and F(100)

F(10) by hand. Write the terms in a row and keep adding the last two: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55. Counting positions from F(0) = 0, the term at index 10 is 55. This is the fastest sanity check for any fibonacci calculator: if a tool cannot reproduce 55 at index 10 under the F(0) = 0 convention, its indexing is shifted and every other answer it gives will be shifted too. The ratio at this point, F(11) / F(10) = 89 / 55 = 1.618181..., already matches the golden ratio to three decimal places.

F(50) and the end of comfortable hand arithmetic. The answer, F(50) = 12,586,269,025, is an 11-digit number that no rough estimate will confirm. Fast doubling reaches it in about six steps. Notice the growth pattern: F(10) has 2 digits, F(50) has 11, and each block of five indices adds roughly one more digit, because the sequence grows by a factor of about phi^5, close to 11, every five steps.

F(100), where floating point gives up. The exact value is 354,224,848,179,261,915,075, with 21 digits - about forty thousand times larger than the biggest integer a double-precision number holds exactly, so a spreadsheet displays a rounded version that is wrong in its last several digits. Checks such as Cassini identity and divisibility tests depend on the exact digits. Enter 100 above, then try 1,000 (209 digits) and 10,000 (2,090 digits); both still return immediately.

The first 30 Fibonacci numbers

The table below lists F(0) to F(29), produced by the same methods this page uses, so you can reproduce any cell in nth term mode or the whole run in the generator. Check the rule as you read: each value is the sum of the two before it, so 21 = 13 + 8 and 514,229 = 317,811 + 196,418. A table that starts 1, 1, 2, 3, 5 is listing the same numbers with indices one lower.

IndexValueIndexValueIndexValue
F(0)0F(1)1F(2)1
F(3)2F(4)3F(5)5
F(6)8F(7)13F(8)21
F(9)34F(10)55F(11)89
F(12)144F(13)233F(14)377
F(15)610F(16)987F(17)1,597
F(18)2,584F(19)4,181F(20)6,765
F(21)10,946F(22)17,711F(23)28,657
F(24)46,368F(25)75,025F(26)121,393
F(27)196,418F(28)317,811F(29)514,229

Two patterns in the table reward a second look. The last digits repeat with a period of 60, the Pisano period. And every third term is even, every fourth is a multiple of 3, and every fifth is a multiple of 5 - in general, F(m) divides F(n) whenever m divides n (for m above 2), which is why F(10) = 55 divides F(50) exactly. Facts like these turn the table from a list into a checking tool.

The golden ratio connection

Divide each Fibonacci number by the one before it and a famous pattern emerges: 1/1 = 1, 2/1 = 2, 3/2 = 1.5, 5/3 = 1.666..., 8/5 = 1.6, 13/8 = 1.625, 21/13 = 1.615..., and the values swing above and below a limit they approach rapidly, the golden ratio phi = (1 + sqrt(5)) / 2 = 1.618033988749895.... The convergence is fast: the ratio at n = 10 agrees with phi to three decimal places, at n = 20 to about seven, and at n = 40 to around sixteen. The calculator shows this directly: for moderate n it prints F(n+1) / F(n) to 25 decimal places, computed by exact BigInt division of the two exact terms and then written as a decimal, so the digits you see are true digits of the exact fraction, not artefacts of floating point division.

Why does the limit have to be phi? If the ratio F(n+1) / F(n) settles at some value L, then dividing the recurrence F(n+1) = F(n) + F(n-1) through by F(n) gives, in the limit, L = 1 + 1/L, which rearranges to L^2 = L + 1 - the defining equation of the golden ratio, whose positive solution is phi. A word of honesty is due here, because the golden ratio attracts exaggeration: it genuinely governs the limit of these ratios and appears in phyllotaxis, the study of plant growth patterns, but many popular claims about phi in art, architecture and the human body do not survive measurement. The mathematics on this page - the ratios, the limit and Binet formula - is exact; the mythology is optional.

Negative indices: the negaFibonacci numbers

The recurrence F(n) = F(n-1) + F(n-2) can be run backwards: F(n-2) = F(n) - F(n-1). Stepping back from F(1) = 1 and F(0) = 0 gives F(-1) = F(1) - F(0) = 1, then F(-2) = F(0) - F(-1) = -1, F(-3) = 2, F(-4) = -3, F(-5) = 5, F(-6) = -8 and F(-7) = 13. The magnitudes are the ordinary Fibonacci numbers in reverse; only the sign alternates. The whole pattern is captured by one rule, F(-n) = (-1)^(n+1) F(n): when n is odd the negative-index term equals F(n), and when n is even it equals -F(n). These are sometimes called the negaFibonacci numbers, and they are not a curiosity bolted onto the sequence - they are what the recurrence itself produces, and identities such as Cassini identity continue to hold for them.

This calculator treats negative indices as first-class input: type -7 in nth term mode and it returns 13; type -100 and it returns -354,224,848,179,261,915,075, the negative of F(100) because 100 is even. The limit is the same in both directions, -10,000 to 10,000, and the computation is fast doubling on the absolute value followed by the sign rule. The golden ratio display is offered for positive moderate n only, since the ratio story belongs to the forward sequence.

Where Fibonacci numbers are used

In nature, the sequence appears because it describes efficient growth. Sunflower seed heads show spiral families whose counts are typically consecutive Fibonacci numbers such as 34 and 55; pinecones commonly show 8 and 13; many flowers have a Fibonacci number of petals. The underlying cause is the golden angle, about 137.5 degrees, at which new seeds or leaves emerge: growth at that angle never lines up wastefully, and the visible spiral counts land on Fibonacci numbers as a consequence.

In computing and mathematics, the naive recursive program for F(n) is the textbook example of exponential run time, making about phi^n calls to compute a value that fast doubling finds in a dozen steps. The worst case of the Euclidean algorithm occurs for consecutive Fibonacci numbers (Lame theorem). Fibonacci heaps are a genuine data structure used in fast graph algorithms, and Zeckendorf theorem says every positive integer is uniquely a sum of non-consecutive Fibonacci numbers. In finance and design, golden ratio proportions and Fibonacci retracement levels are widely used conventions; they are human conventions rather than laws of markets, and this page presents them as such.

ApplicationHow Fibonacci numbers appearExample
Plant growth (phyllotaxis)Spiral counts in seed heads, pinecones and petals34 and 55 spirals in a sunflower head
Algorithm analysisWorst case of the Euclidean algorithm; recursion run timesgcd steps peak at consecutive terms like 34 and 55
Data structuresFibonacci heaps in graph algorithmsFaster decrease-key in Dijkstra shortest paths
Number theoryDivisibility: F(m) divides F(n) when m divides nF(10) = 55 divides F(50)
RepresentationZeckendorf representation of integers100 = 89 + 8 + 3
Design and financeGolden ratio proportions; retracement levels by convention38.2% and 61.8% retracement levels

Common Fibonacci mistakes

Mixing up the starting convention. Half the disagreements about Fibonacci numbers are really disagreements about indexing. With F(0) = 0 and F(1) = 1, the tenth term is 55 and the sequence begins 0, 1, 1, 2, 3, 5. A source that starts F(1) = 1, F(2) = 1 will call 55 the eleventh term or renumber everything. Neither is wrong in itself, but copying a value from one convention into a calculation built on the other shifts every answer by one place. This page states its convention at the top and sticks to it in the tool, the table and every example.

Trusting floating point for large terms. Spreadsheets store F(100) as a rounded approximation while displaying it with total confidence, and overflow entirely around F(1,476). If a check depends on exact digits, use exact arithmetic - the reason this calculator is built on BigInt. Believing Binet formula is a shortcut to exact answers. Evaluated in floating point it gives approximations that drift as n grows. Expecting the ratio to equal phi at small n. F(6) / F(5) = 1.6 is only a rough neighbour of the golden ratio; the convergence is a limit, reached to useful precision around n = 20. Rejecting negative indices. The recurrence extends backwards cleanly, and F(-7) = 13 is as well defined as F(7) = 13.

Limits, exactness and what this tool does not do

Quick answer: Nth term mode covers -10,000 to 10,000 exactly; F(10,000) has 2,090 digits. The generator covers the first 500 terms or terms up to F(10,000). Integer results are exact BigInt values; the golden ratio display is a 25-decimal-place rendering of the exact fraction F(n+1) / F(n).

The limits are stated openly rather than discovered by failure. Nth term mode accepts any index from -10,000 to 10,000; beyond a few thousand digits the result stops being readable and no ordinary school, interview or engineering task needs more. The generator is capped at the first 500 terms, and the up to a value mode accepts values no larger than F(10,000). Within those limits every integer shown is exact: no rounding, and no Binet approximation anywhere in the pipeline.

Honesty about the one approximation: the golden ratio convergence figure is the exact fraction F(n+1) / F(n) written out to 25 decimal places, which necessarily stops somewhere; the digits shown are correct digits of that fraction, and the fraction itself is a rational approximation to the irrational phi, approaching it as n grows. This tool is a calculator, not an AI and not a maths tutor: it does not solve general recurrence relations, generate Lucas or Tribonacci sequences, or prove identities. For neighbouring work, the factorial and standard deviation tools linked below cover counting and statistics, and the sources that follow are the right places to read further.

Sources and References

Every figure in this guide was calculated with this page's own method, so you can reproduce each one exactly by entering the same numbers above. All seven sources above were checked live while this page was written. One substitution was needed: the Encyclopaedia Britannica Fibonacci number page could not be reached from our checker (it returned HTTP 403), so Plus Magazine, published by the University of Cambridge Millennium Mathematics Project, is listed in its place.