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
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.
- Choose Fibonacci or Lucas — both use the same add-the-previous-two rule and differ only in their starting pair.
- Enter the index you want, counting from 0. F(0) = 0, F(1) = 1, F(10) = 55, F(20) = 6765.
- Read the exact value at the top. It is the full integer with every digit correct, not a rounded approximation.
- 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.
- 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.
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.
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.
Frequently asked questions.
What is the Fibonacci sequence?
Does the sequence start at 0 or at 1?
What is the 100th Fibonacci number?
How is the Fibonacci sequence related to the golden ratio?
What are Lucas numbers and why are they on this page?
Why is the index capped at 300?
What is the sum of the first n Fibonacci numbers?
What is Binet's formula, and does this page use it?
Where do Fibonacci numbers actually appear?
References& sources.
- [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]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]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]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]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