🧮
🧮 Math & statistics

Fibonacci Number Calculator

Results update as you type.

Your numbers

Understanding the Fibonacci number calculator — concept and principle

The Fibonacci sequence starts 0, 1, 1, 2, 3, 5, 8, 13, … and each number is the sum of the two before it. This calculator gives the exact value of F(n) for any n from 0 to 2,000, using whole-number arithmetic without rounding, and shows the ratio F(n) ÷ F(n − 1), which approaches the golden ratio. Fibonacci numbers appear in programming exercises, algorithm analysis and combinatorics.

Fibonacci squares and spiralSquares of side 1, 1, 2, 3, 5, 8 tile a rectangle with a spiral; F(50) = 12,586,269,025 and the ratio of neighbours approaches 1.618.Each number = the two before added235811235813…5 + 8 = 13squares of these sizes tileinto a spiralF(50)12,586,269,025F(50) ÷ F(49) ≈ 1.618034the golden ratio φ
Adding the two previous numbers builds the sequence; by F(50) the ratio of neighbours is the golden ratio.

How it is calculated

n must be a whole number between 0 and 2,000.

The principle

The sequence first appeared in Western mathematics in Leonardo of Pisa's Liber Abaci (1202), as a puzzle about breeding rabbits: each month the number of pairs equals last month's pairs plus the newborn pairs, which equal the pairs from two months earlier. A closed form, Binet's formula, is F(n) = (φⁿ − ψⁿ) ÷ √5, where φ = (1 + √5) ÷ 2 ≈ 1.618034 and ψ = (1 − √5) ÷ 2 ≈ −0.618034. Because |ψ| < 1, the ψⁿ term fades quickly, so F(n) is the nearest whole number to φⁿ ÷ √5 and the ratio of neighbouring terms tends to φ.

Worked example

  1. Input: n = 50.
  2. Starting from F(0) = 0 and F(1) = 1, add repeatedly: …, F(48) = 4,807,526,976, F(49) = 7,778,742,049.
  3. F(50) = 4,807,526,976 + 7,778,742,049 = 12586269025.
  4. Check with Binet: φ⁵⁰ ÷ √5 ≈ 12,586,269,025.0, which rounds to the same value.
  5. Ratio: 12,586,269,025 ÷ 7,778,742,049 ≈ 1.618033989, equal to φ to all displayed digits.

How to read the result

Fibonacci numbers grow by a factor of about 1.618 per step, so F(n) has roughly 0.209 × n digits: F(50) has 11 and F(100) has 21. The ratio F(n) ÷ F(n − 1) alternates slightly above and below φ and agrees with it to about 9 decimal places by n = 25. Familiar patterns follow from the definition, for example every third Fibonacci number is even.

Common mistakes

Keep in mind: The ratio column is computed in floating point and is shown to about 10 significant digits. The F(n) value itself is exact, but for very large n it can be hundreds of digits long.

Frequently asked questions

What is F(100)?

F(100) = 354,224,848,179,261,915,075, a 21-digit number.

Is 0 a Fibonacci number?

In the modern convention used here, yes: F(0) = 0. Some older texts begin the sequence at 1, 1.

How are Fibonacci numbers related to Pascal's triangle?

The sums along the shallow diagonals of Pascal's triangle are the Fibonacci numbers 1, 1, 2, 3, 5, 8, ….

Sources: Leonardo of Pisa (Fibonacci), Liber Abaci (1202) · Donald E. Knuth, The Art of Computer Programming, Vol. 1, §1.2.8 (Fibonacci Numbers) · OEIS Foundation, The On-Line Encyclopedia of Integer Sequences, A000045

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →