Audited 29 Jul 2026·Last updated 31 Jul 2026·5 citations·Tier 1·0 uses

Fibonacci Calculator

Get the exact nth Fibonacci number up to F(300), its neighbours, the running total, and how close the ratio has come to the golden ratio. Lucas numbers too.

Fibonacci Calculator

Which sequence?
Counting from 0: F(0) = 0, F(1) = 1, F(2) = 1. Capped at 300, where the exact value already runs to 63 digits.
Exact value
6765
The exact integer, computed by the recurrence at 400-digit precision. Every digit shown is correct, at any index this page accepts.
As a number
6,765
Previous term
4,181
Next term
10,946
Sum of terms 0 through n
17,710
Digits
4
Sequence
0, 1, 1, 2, 3, 5, …, 6765 (terms F(0) through F(20))
Ratio to the previous term
F(20) ⁄ F(19) = 6765 ⁄ 4181 = 1.6180339632, which sits 2.558e-8 away from φ = 1.6180339887.

Background.

The Fibonacci sequence is the most famous recurrence in mathematics: start with 0 and 1, and make every later number the sum of the two before it. That gives 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, and onward forever. This calculator returns the exact value of any term up to index 300, along with its immediate neighbours, the running total of every term up to that point, the number of digits it has, and how close its ratio to the previous term has drifted toward the golden ratio φ. It also handles the Lucas numbers, the sequence's less famous twin, which obeys exactly the same rule but starts from 2 and 1 instead.

Every digit this page prints is correct. That sounds like a low bar, but Fibonacci numbers outgrow ordinary floating-point arithmetic surprisingly quickly: F(79) is the first term that a standard double-precision number cannot hold exactly, and by F(100) — 354224848179261915075 — a naive implementation is already wrong from the seventeenth digit onward. This calculator runs the recurrence inside a 400-digit decimal engine, so the exact integer is the headline result and the floating-point version is shown separately and labelled as an approximation rather than passed off as the answer. The index cap of 300 exists for the same reason: F(300) has 63 digits, and printing anything beyond that stops being legible on a phone. The page states the cap rather than quietly switching to a rounded value.

Indexing is where most confusion about this sequence starts, so the convention is fixed and stated up front: this page counts from 0, with F(0) = 0, F(1) = 1, F(2) = 1, F(3) = 2. That is the convention used by OEIS and by MathWorld, which notes that F(0) = 0 is adopted by convention on top of the defining F(1) = F(2) = 1. If your textbook prints the sequence as '1, 1, 2, 3, 5, 8' and calls the first 1 the first term, it is indexing from F(1) — and it agrees with this page for every index of 1 or more. The only difference is whether the leading zero gets written down at all, which is why there is no convention switch on this page: there would be nothing for it to change.

The golden ratio line is the most interesting output here. Divide any Fibonacci number by the one before it and you get something close to φ = 1.6180339887…, and the approximation gets better every step. At index 5 the ratio 5 ⁄ 3 = 1.667 is still nearly 0.05 away from φ; by index 20 the gap has shrunk to about 2.6 × 10⁻⁸; by index 100 it is smaller than 10⁻⁴¹. MathWorld attributes the first proof of this limit to Robert Simson in 1753. The one place the ratio simply does not exist is index 1, where the previous term is 0 — this page says so in words rather than returning infinity.

The running total has an identity worth knowing: adding every term from index 0 through n always gives you the term at index n + 2, minus 1. For the twenty-one terms up to F(20) that is F(22) − 1 = 17711 − 1 = 17710. The same identity holds for Lucas numbers, because it follows from the shared recurrence rather than from the particular starting values. This calculator adds the terms up one at a time rather than using the shortcut, so the identity serves as an independent check on the result instead of being assumed by it.

If you have a list of numbers and want to know whether they follow a Fibonacci-style rule at all, use the sequence calculator, which recognises that family alongside arithmetic, geometric and quadratic patterns. If your numbers grow by a fixed amount or a fixed factor per step rather than by summing their predecessors, the arithmetic sequence and geometric sequence calculators are the right tools.

What is fibonacci calculator?

The Fibonacci numbers are defined by the two-step recurrence F(n) = F(n−1) + F(n−2) with F(1) = F(2) = 1, and with F(0) = 0 adopted by convention — MathWorld states it in exactly that form. Unlike an arithmetic or geometric sequence, where each term depends on one predecessor and a closed form falls straight out, a Fibonacci term depends on two predecessors. There is still a closed form, Binet's formula F(n) = ((1+√5)ⁿ − (1−√5)ⁿ)/(2ⁿ√5), but it is built from irrational numbers that cancel exactly to give an integer, which makes it a poor way to compute the value and an excellent way to check one. The Lucas numbers obey the same recurrence with different seeds, L(0) = 2 and L(1) = 1, giving 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123 — the Encyclopedia of Mathematics records those seeds and the parallel closed form. The two sequences are deeply linked: their ratios both converge to the golden ratio φ = (1+√5)/2, and both satisfy the same summation identity, Σ of terms 0 through n equals the term at index n + 2 minus 1.

How to use this calculator.

  1. Choose Fibonacci or Lucas — both use the same add-the-previous-two rule and differ only in their starting pair.
  2. Enter the index you want, counting from 0. F(0) = 0, F(1) = 1, F(10) = 55, F(20) = 6765.
  3. Read the exact value at the top. It is the full integer with every digit correct, not a rounded approximation.
  4. Use the digit count to see how fast the sequence is growing, and the sum output for the running total of every term up to your index.
  5. Check the ratio line to see how close this term has brought you to the golden ratio — the gap shrinks by roughly a factor of 2.6 with every step.

The formula.

F(n) = F(n−1) + F(n−2), F(0) = 0, F(1) = 1

The definition is the whole calculation: each term is the sum of the two before it, so the only thing needed to reach index n is a pair of starting values and n additions. This calculator does exactly that — an integer walk from the seeds — rather than evaluating Binet's closed form, because the recurrence is exact by construction while Binet's formula requires irrational arithmetic that must be rounded back to an integer at the end. Binet is instead used as an independent check in the test suite, where it is evaluated at 400-digit precision and confirmed to reproduce the walk for every index from 0 to 90. A second check comes from the summation identity: because each term satisfies a(k) = a(k+2) − a(k+1), adding the terms from index 0 to n telescopes to a(n+2) − a(1), and since both supported sequences have a(1) = 1 the total is always the term at index n + 2 minus 1. The calculator accumulates the sum one term at a time, so this identity confirms the result rather than producing it. On precision: the recurrence runs inside a private decimal engine carrying 400 significant digits, which is far more than the 63 digits F(300) needs, so no intermediate value is ever rounded. The exact integer is reported as the primary result. The floating-point version shown alongside it is that exact integer narrowed to a double at the very last step, which is exact through F(78) and an approximation above it — the page labels it as such rather than presenting it as the answer. The only irrational arithmetic anywhere on the page is φ itself and the ratio comparison, both computed at 400 digits and rounded once, for display.

A worked example.

Example

Ask for index 20 of the Fibonacci sequence. Walking the rule from F(0) = 0 and F(1) = 1 gives 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, and finally 6765 — so the exact value output is 6765 and the digit count output is 4. The previous term output is 4181 and the next term output is 10946, which is simply 6765 + 4181. The sum output adds every term from index 0 to index 20 and returns 17710; you can check that against the identity, since the term at index 22 is 17711 and 17711 − 1 = 17710. The ratio line divides 6765 by 4181 to get 1.6180339632, which sits about 2.6 × 10⁻⁸ below the golden ratio φ = 1.6180339887 — already accurate to seven decimal places after only twenty steps. Switching the sequence selector to Lucas and keeping the same index returns 15127 instead, with a previous term of 9349, a next term of 24476, and a running total of 39602, which again matches the identity: the Lucas term at index 22 is 39603.

term Index20
sequence Typefibonacci

Frequently asked questions.

What is the Fibonacci sequence?
A sequence in which each number is the sum of the two before it, starting from 0 and 1: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144. It is defined by the recurrence F(n) = F(n−1) + F(n−2), and unlike an arithmetic or geometric sequence it depends on two predecessors rather than one, which is why it has no simple closed form built from ordinary arithmetic.
Does the sequence start at 0 or at 1?
Both conventions are in use and they do not actually disagree. This page indexes from 0, with F(0) = 0, F(1) = 1, F(2) = 1 — the convention used by OEIS and stated by MathWorld. A textbook that prints '1, 1, 2, 3, 5' and calls the first 1 the first term is indexing from F(1), and it gives the same value as this page for every index of 1 or more. The only difference is whether the leading 0 is written down.
What is the 100th Fibonacci number?
F(100) = 354224848179261915075, a 21-digit integer. It is worth knowing that ordinary double-precision arithmetic cannot hold it: F(79) is already the first term too large to represent exactly, and by F(100) a naive calculator is wrong from the seventeenth digit. This page computes the recurrence at 400-digit precision, so the exact value shown is exact.
How is the Fibonacci sequence related to the golden ratio?
Divide any Fibonacci number by the one before it and the answer approaches φ = (1 + √5)/2 ≈ 1.6180339887. The approximation improves fast: at index 5 the ratio 5/3 is about 0.049 from φ, at index 20 it is about 2.6 × 10⁻⁸ away, and at index 100 it is closer than 10⁻⁴¹. MathWorld credits the first proof of this limit to Robert Simson in 1753. The one index where the ratio does not exist is 1, because the previous term is 0.
What are Lucas numbers and why are they on this page?
The Lucas numbers obey the identical recurrence — each term is the sum of the two before it — but start from 2 and 1 instead of 0 and 1, giving 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123. They are the natural companion sequence: their consecutive ratios converge to the same golden ratio, they satisfy the same summation identity, and many Fibonacci identities have a Lucas mirror. Because the calculation is the same walk from a different starting pair, both live on one page rather than two near-identical ones.
Why is the index capped at 300?
Because this page prints the exact integer rather than an approximation, and F(300) already has 63 digits. Past that the exact value stops being something you can read on a screen, and quietly switching to a rounded floating-point value would make the page say something it does not mean. The cap is stated in the field, in the error message and here, rather than being a silent failure.
What is the sum of the first n Fibonacci numbers?
Adding every term from index 0 through n gives the term at index n + 2, minus 1. For the terms up to F(20), that is F(22) − 1 = 17711 − 1 = 17710. The identity follows from the recurrence alone, so it holds for Lucas numbers too. This calculator adds the terms one at a time rather than applying the shortcut, which means the identity acts as an independent check on the answer.
What is Binet's formula, and does this page use it?
Binet's formula is the closed form F(n) = ((1+√5)ⁿ − (1−√5)ⁿ)/(2ⁿ√5). It is remarkable because two irrational expressions cancel to give an exact integer every time. This page does not use it to compute results — the integer recurrence is exact by construction, where Binet requires irrational arithmetic that has to be rounded back to a whole number. Binet is instead used in the test suite as an independent second method, confirmed to reproduce the recurrence for every index from 0 to 90.
Where do Fibonacci numbers actually appear?
In genuine mathematical settings: the number of ways to tile a 2×n strip with dominoes, the shallow diagonals of Pascal's triangle, the worst-case step count of the Euclidean algorithm, and the growth of certain plant phyllotaxis patterns where the spiral counts are consecutive Fibonacci numbers. Many popular claims about the sequence in art and architecture are retrofitted rather than documented, so this page sticks to the mathematics it can cite.

References& sources.

  1. [1]Wolfram MathWorld, 'Fibonacci Number' — the recurrence F_n = F_(n−1) + F_(n−2) with F₁ = F₂ = 1 and F₀ = 0 by convention (eq. 1); Binet's formula (eq. 6); the summation identity Σ_(k=1)^(n) F_k = F_(n+2) − 1 (eq. 22); and lim F_n/F_(n−1) = φ (eq. 78, first proved by Robert Simson in 1753). Retrieved 2026-07-29; open access.
  2. [2]Wolfram MathWorld, 'Lucas Number' — L_n = L_(n−1) + L_(n−2) with L₁ = 1 and L₂ = 3 (which forces L₀ = 2), and the printed run 1, 3, 4, 7, 11, 18, 29, 47, 76, 123. Retrieved 2026-07-29; open access.
  3. [3]Encyclopedia of Mathematics (European Mathematical Society), 'Fibonacci numbers' — independent check: u₁ = u₂ = 1 with u_(n+1) = u_n + u_(n−1); the Binet closed form; lim u_(n+1)/u_n = φ; and the Lucas companion with v₀ = 2, v₁ = 1. Confirms F(20) = 6765 and the Lucas seeds used here. Retrieved 2026-07-29; open access.
  4. [4]NIST Digital Library of Mathematical Functions, §5.2(ii), equation 5.2.3 — the digit discipline used for irrational constants on Quanta's sequence pages; φ is quoted to the same standard. Retrieved 2026-07-29; open access.
  5. [5]OEIS Foundation, sequences A000045 (Fibonacci) and A000032 (Lucas) — the canonical index registrations, both with offset 0. Listed for the reader's reference only: oeis.org returned HTTP 403 to this session, so the 0-based offsets were confirmed against MathWorld and the Encyclopedia of Mathematics instead and nothing on this page depends on this entry alone.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 977 calculators remain free
  • No billing is enabled
Coming soon