Fibonacci Calculator: Your Simple Number Companion

Formula: F(n) = F(n-1) + F(n-2), where F(0) = 0 and F(1) = 1

Note: Maximum position is 78 to prevent number overflow. The ratio between consecutive numbers approaches the Golden Ratio (φ ≈ 1.618034)

This fibonacci calculator computes numbers in the Fibonacci sequence. Use it to find specific Fibonacci numbers and view related details.

How the sequence is built

Each Fibonacci number is the sum of the two before it: F(0) = 0, F(1) = 1, and every term after that is F(n) = F(n-1) + F(n-2). The calculator builds the sequence iteratively from the bottom up rather than using recursion, so it stays fast even near the upper end of its range.

Worked example: position 10

Starting from F(0)=0 and F(1)=1, each term is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55. That last value, 55, is F(10). The golden-ratio panel then divides F(10) by F(9): 55 / 34 = 1.6176470588. The true golden ratio φ = (1 + √5) / 2 = 1.6180339887, so the difference at position 10 is about 0.0003869 — close, but not yet inside the calculator's 0.0001 "very close" threshold. Push the position higher (try 20 or 30) and the ratio converges tighter, since each additional term roughly cuts the gap by a factor of φ².

Why it caps at 78

JavaScript's Number type loses exact integer precision above 2^53 (about 9 quadrillion). F(78) is 8,944,394,323,791,464 — right at the edge of what a standard JS number can represent exactly — so the input is capped there to avoid returning a Fibonacci number that's silently wrong due to floating-point rounding.

Where this sequence shows up

Beyond textbook recursion examples, Fibonacci-derived ratios approximate the golden ratio found in phyllotaxis (leaf and seed spiral arrangements in plants), and the sequence itself is a standard example for teaching recursion, dynamic programming, and iterative algorithm design in computer science courses.