Home › Math › Fibonacci Calculator

Fibonacci Sequence Calculator

Enter how many terms you want, starting from F₀ = 0. The calculator lists the sequence, the last term, the sum, and the ratio between the last two terms.

terms

Last term

—

Sequence
—
Sum of terms
—
Ratio of last two terms
—

Each number is the sum of the two before it

Start with 0 and 1, add them, then keep adding the last two numbers. That single rule produces the Fibonacci sequence, which turns up in rabbit-breeding puzzles, sunflower seed heads, computer science interviews and stock-chart folklore. This calculator lists as many terms as you ask for, totals them and shows how fast the ratio of neighbours settles down.

With 10 terms the sequence is 0, 1, 1, 2, 3, 5, 8, 13, 21, 34. The last term is F9 = 34, the terms add to 88, and 34 ÷ 21 gives 1.61904762 (φ ≈ 1.61803399).

Rules and shortcuts

F₀ = 0, F₁ = 1, Fₙ = Fₙ₋₁ + Fₙ₋₂
Binet's formula: Fₙ = (φⁿ − ψⁿ) ÷ √5, where φ = (1 + √5) ÷ 2 and ψ = (1 − √5) ÷ 2
Sum of F₀ through Fₙ = Fₙ₊₂ − 1

Here n is the position in the sequence, counted from zero, φ (phi) is the golden ratio, about 1.6180339887, and ψ is its small negative partner, about −0.618. Because ψⁿ shrinks towards zero, Fₙ is simply φⁿ ÷ √5 rounded to the nearest whole number for every n.

The sum rule is a handy check on long lists: ten terms (F₀ to F₉) add to 88, and F₁₁ is 89.

How quickly the ratio converges

Ratio of consecutive terms1.51.61.71.81.923579Term number nφ ≈ 1.618
Ratio of each term to the one before it, for the terms you asked for. The dashed line is the golden ratio, 1.618.

The ratio swings above and below φ, overshooting less each time. After 5 terms it is still 0.12 away; after 10 it is within about 0.001; by 20 terms the gap is under one ten-millionth. That alternating approach is why φ is sometimes called the "most irrational" number: its continued fraction is all ones, the slowest possible to converge.

A picture of the sequence

Fibonacci squares and spiral58132134
Squares with Fibonacci side lengths, up to your term count (at most ten squares), joined by a quarter-circle spiral. Original diagram drawn from the sequence.

Squares whose sides are Fibonacci numbers fit together into ever larger rectangles, each close to the golden proportion. Joining quarter-circles through the squares gives the familiar spiral. It is a good approximation of a logarithmic spiral, though not an exact one.

Where you will actually meet it

  • Programming: computing Fₙ is the classic example of recursion versus iteration. A naive recursive function repeats work exponentially; the loop this calculator uses is linear.
  • Agile estimation: many teams size tasks with 1, 2, 3, 5, 8, 13 because the widening gaps discourage false precision.
  • Botany: spiral counts on pinecones and sunflowers are often consecutive Fibonacci numbers, a side effect of how new growth is packed in.
  • Trading: "Fibonacci retracement" levels use ratios like 61.8%. They are a convention, not a law of markets.

Limits

JavaScript numbers hold integers exactly only up to about 9 × 10¹⁵, so the calculator stops at 78 terms, where F₇₇ = 5,527,939,700,884,757. Beyond that, digits would silently round. For the same reason, the sum is exact only within that range.

Related tools: the GCD and LCM calculator (consecutive Fibonacci numbers always have a GCD of 1), the quadratic solver (φ is a root of x² − x − 1 = 0) and the percentage calculator.

Fibonacci sequence questions

What is the 10th Fibonacci number?

It depends on whether you count from F₀ = 0 or F₁ = 1. Counting from F₀, the tenth term listed is F₉ = 34; F₁₀ itself is 55.

What is the golden ratio?

φ = (1 + √5) ÷ 2, about 1.6180339887. The ratio of consecutive Fibonacci numbers approaches it as the sequence grows.

What is the sum of the first 20 Fibonacci numbers?

F₀ through F₁₉ add to 10,945, which equals F₂₁ − 1 = 10,946 − 1.

Why does the calculator stop at 78 terms?

F₇₇ is the largest term that standard JavaScript numbers store exactly. Later terms would be rounded.

Related calculators