Fibonacci Calculator
Find the exact Fibonacci number at any position in the sequence, where each term is the sum of the two before it. Use it to explore mathematical patterns, the golden ratio, and algorithm examples.
Last updated: May 2026
Compare with similar
About this calculator
The Fibonacci sequence is defined by the recurrence F(n) = F(n − 1) + F(n − 2), starting from F(0) = 0 and F(1) = 1, giving 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, and so on. This calculator takes a position n and returns the nth term, computed iteratively: it keeps the last two values and adds them n − 1 times, which is fast and avoids the exponential blow-up of naive recursion. The single input is the position (n). Edge cases follow the standard indexing: F(0) = 0 and F(1) = 1 are the base cases, and non-positive positions return 0 here. A defining feature is the link to the golden ratio φ = (1 + √5)/2 ≈ 1.618: the ratio of consecutive Fibonacci numbers F(n+1)/F(n) approaches φ as n grows, and Binet's formula F(n) = (φⁿ − ψⁿ)/√5 (with ψ = (1 − √5)/2) gives a closed form. Be aware that indexing conventions vary — some sources start the sequence at F(1) = 1, F(2) = 1 — so always confirm whether position 1 means 0 or 1. Like factorials, Fibonacci numbers grow quickly (roughly geometrically by φ), so very large positions overflow standard number precision.
How to use
Example 1 — the 10th Fibonacci number. Enter Position (n) = 10. Building the sequence from F(0): 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, the value at position 10 is 55. Verify with the recurrence: F(10) = F(9) + F(8) = 34 + 21 = 55. Example 2 — the 15th Fibonacci number. Enter Position (n) = 15. Continuing the sequence: F(11) = 89, F(12) = 144, F(13) = 233, F(14) = 377, F(15) = 610. So F(15) = 610. Verify the golden-ratio property: F(15)/F(14) = 610 / 377 ≈ 1.6180, already extremely close to φ ≈ 1.61803.
Frequently asked questions
Does the sequence start at position 0 or 1?
This calculator uses the common convention F(0) = 0 and F(1) = 1, so position 0 returns 0. However, conventions differ: many textbooks index from F(1) = 1 and F(2) = 1, which shifts every position by one. This is the single most frequent source of confusion and off-by-one errors when people compare results between tools or sources. Whenever you read a 'nth Fibonacci number', check which starting index is meant. Here, simply remember that position 1 gives 1 and position 0 gives 0.
How is the Fibonacci sequence related to the golden ratio?
The ratio of consecutive Fibonacci numbers, F(n+1)/F(n), converges to the golden ratio φ = (1 + √5)/2 ≈ 1.61803 as n increases. Even by the 15th term the ratio 610/377 ≈ 1.61803 is accurate to five decimals. This connection is made exact by Binet's formula, F(n) = (φⁿ − ψⁿ)/√5, which expresses each term using φ and its conjugate ψ. The relationship is why Fibonacci numbers appear alongside the golden ratio in art, architecture, and spiral growth patterns. It also gives a way to estimate large Fibonacci numbers quickly using φⁿ/√5.
Why is iterative computation better than naive recursion?
A naive recursive definition recomputes the same subproblems over and over: calculating F(n) by directly recursing on F(n−1) and F(n−2) leads to roughly φⁿ calls, which is exponential and unusably slow for moderate n. The iterative method this calculator uses keeps just the last two values and loops, doing the work in linear time and constant memory. This is a classic teaching example of why dynamic programming or simple iteration beats unmemoized recursion. For even larger inputs, fast-doubling or matrix-exponentiation methods reach logarithmic time. The takeaway is that the algorithm, not just the formula, determines whether large Fibonacci numbers are feasible.
Where do Fibonacci numbers actually appear in nature and computing?
They show up in phyllotaxis — the arrangement of leaves, seeds, and petals — where counts like the spirals in a sunflower head or pinecone are frequently Fibonacci numbers, because that packing is efficient. In computing they underlie data structures (Fibonacci heaps), the analysis of the Euclidean algorithm's worst case, and search techniques. They also appear in financial technical analysis, though those uses are far less rigorous than the mathematical ones. A common overstatement is to see Fibonacci patterns everywhere; many claimed sightings are coincidental or cherry-picked. The genuine appearances stem from the same recurrence and golden-ratio geometry.
When should I NOT use this Fibonacci calculator?
Avoid it for very large positions if you need exact values, since standard number types overflow (Fibonacci numbers grow geometrically, so precision is lost well before n = 100); use big-integer arithmetic instead. Be cautious comparing its output with sources that use a different starting index, or you will be off by one position. It is also not the tool for generating the whole sequence at once — a sequence generator is better if you need every term up to n. And do not rely on it for the Lucas numbers or other Fibonacci-like sequences, which share the recurrence but use different starting values. Match the tool to whether you need one term, the full list, exactness, or a related sequence.