Fibonacci Calculator

F(20) — the 20th Fibonacci number6,765
F(21) — the next term10,946
Sum of the first 20 terms (F(1)…F(20))17,710
F(20) ÷ F(19) — approaching φ1.618
How this was calculated
  1. Each term is the sum of the two before it, starting 0, 1: 0, 1, 1, 2, 3, 5, 8, 13… Counting to term 20 gives F(20) = 6,765 (computed exactly, with arbitrary-precision integer arithmetic — no rounding).
  2. A famous shortcut checks the work: the sum of the first n terms equals F(n+2) − 1 = 17,710. And as n grows, the ratio of consecutive terms settles on the golden ratio φ ≈ 1.618034.

Our Fibonacci calculator lets you find any term in the Fibonacci sequence instantly. The sequence starts 0, 1 and each term is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34… Whether you need a small value or a large one, the calculator returns the exact result. For reference, F(10) = 55, F(20) = 6,765 and F(30) = 832,040. It also handles sums across terms — the first 20 terms sum to 17,710, matching the identity sum = F(n+2) − 1 = F(22) − 1. The ratio of consecutive terms approaches the golden ratio, and indeed F(30)/F(29) = 1.618034, matching the golden ratio φ to six decimal places.

The method behind this calculator is the accepted standard because it relies on iterative exact addition rather than approximations. Terms grow exponentially — F(100) has 21 digits — so exact values need arbitrary-precision (BigInt) arithmetic rather than ordinary floating point. Binet's formula gives F(n) directly from φ, but rounding errors make it unreliable for large n; iterative exact addition never drifts. This page shows the formula, step-by-step workings, worked examples and sources so you can verify every result yourself.

Worked examples

F(20)

6,765 — and the first 20 terms sum to 17,710, exactly F(22) − 1 as the shortcut promises. (20)

F(20) — the 20th Fibonacci number6,765
F(21) — the next term10,946
Sum of the first 20 terms (F(1)…F(20))17,710
F(20) ÷ F(19) — approaching φ1.618

F(30)

832,040. By term 30 the ratio F(30)/F(29) matches φ to six decimals: 1.618034. (30)

F(30) — the 30th Fibonacci number832,040
F(31) — the next term1,346,269
Sum of the first 30 terms (F(1)…F(30))2,178,308
F(30) ÷ F(29) — approaching φ1.618

F(10)

55 — the last Fibonacci number you can count on two hands of fingers with room to spare. (10)

F(10) — the 10th Fibonacci number55
F(11) — the next term89
Sum of the first 10 terms (F(1)…F(10))143
F(10) ÷ F(9) — approaching φ1.6176

The rabbit sequence, briefly

In 1202, Leonardo of Pisa — better known as Fibonacci — posed a puzzle about rabbits breeding in an enclosed field. The mathematical sequence that emerged from that puzzle begins with 0 and 1, and every term after that is simply the sum of the previous two. The result is the famous series 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on without end. This recurrence is written compactly as F(n) = F(n−1) + F(n−2), with the starting values F(0) = 0 and F(1) = 1. A fibonacci calculator uses exactly this rule to generate any term you request.

The sequence grows slowly at first but accelerates steadily. The 10th term, F(10), equals 55. By the 20th term the value has reached 6,765, and by the 30th it stands at 832,040. Those figures also illustrate a neat identity: the first 20 terms sum to 17,710, which matches the formula sum = F(n+2) − 1, here equal to F(22) − 1. This kind of internal consistency is what makes the sequence so useful for testing mathematical software.

Another striking property appears when you divide consecutive terms. The ratio F(30)/F(29) equals 1.618034, which matches the golden ratio φ to six decimal places. As the terms climb higher, this ratio settles ever closer to φ. The connection between Fibonacci numbers and the golden ratio is no accident — it falls directly out of Binet's formula, which expresses F(n) in closed form using φ. Binet's formula is elegant, but rounding errors creep in for large n, making it unreliable for exact computation. Iterative addition — just adding the previous two terms over and over — never drifts, which is why a well-built fibonacci calculator relies on that method instead.

Speed matters, but so does precision. Because the terms grow exponentially, F(100) already has 21 digits, far beyond what ordinary floating-point numbers can represent exactly. Any fibonacci calculator that hopes to produce correct values at that scale must use arbitrary-precision arithmetic, often called BigInt, rather than standard decimal types. Without it, the tool will silently round or truncate large results and give you a number that looks right but is not. The combination of simple addition and BigInt arithmetic keeps every digit exact, whether you ask for the 10th term or the 1,000th.

Worked examples

These worked examples show what a fibonacci calculator produces for common inputs. The Fibonacci sequence starts 0, 1 and each term is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34… The values climb quickly, so checking a few reference points helps confirm your tool is working correctly.

The table below lists verified results for three inputs. F(10) equals 55, which is a useful mid-range check. F(20) equals 6,765, and the first 20 terms sum to 17,710. That sum matches the identity sum = F(n+2) − 1 = F(22) − 1, giving you a second way to verify the output. F(30) equals 832,040, and the ratio F(30)/F(29) equals 1.618034, matching the golden ratio φ to six decimal places.

Terms grow exponentially — F(100) has 21 digits — so exact values need arbitrary-precision (BigInt) arithmetic rather than ordinary floating point. A calculator that relies on standard floating-point math will eventually round or truncate large results, producing numbers that look right at first but drift away from the true sequence as n increases.

Binet's formula gives F(n) directly from φ, but rounding errors make it unreliable for large n. Iterative exact addition never drifts, because each step simply adds two integers with no rounding involved. This is why a dependable fibonacci calculator uses iterative addition under the hood rather than a closed-form shortcut.

nF(n)Additional result
1055—
206,765Sum of first 20 terms = 17,710
30832,040F(30)/F(29) = 1.618034
If your fibonacci calculator returns a value for F(100) that does not have exactly 21 digits, it is likely using floating-point math and producing rounded results.

The golden ratio connection

Divide any Fibonacci term by the one before it and a striking pattern emerges. The sequence begins 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and each term is the sum of the previous two. As you move further along, the ratio between consecutive terms stops wandering and locks onto a single value: the golden ratio, written as φ and approximately equal to 1.618034.

The convergence is steady but not instant. Early ratios bounce around — 1/1 equals 1, 2/1 equals 2, 3/2 equals 1.5, 5/3 equals 1.667 — but the swings shrink with every step. By the time you reach F(10) = 55, the ratio is already close. Push further to F(20) = 6,765 and the match tightens. At F(30) = 832,040, the ratio F(30) divided by F(29) equals 1.618034, which matches the golden ratio φ to six decimal places. A fibonacci calculator that uses exact integer arithmetic can show this convergence precisely, term after term, without the drift that plagues shortcut methods.

The link between Fibonacci numbers and φ runs deeper than a numerical coincidence. Binet's formula makes the connection explicit: it computes F(n) directly from φ using a closed-form expression, bypassing the iterative addition entirely. In theory, this means you could calculate any Fibonacci number with a single formula. In practice, rounding errors creep in because φ is an irrational number — its decimal expansion never terminates and never repeats. Those tiny errors stay harmless for small n but compound as n grows, making Binet's formula unreliable for large values.

This is why exact iterative addition remains the gold standard. Terms grow exponentially — F(100) has 21 digits — so ordinary floating-point arithmetic eventually loses precision. Arbitrary-precision arithmetic, such as BigInt in JavaScript, preserves every digit by storing numbers as exact integers and adding them step by step: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and onward. The method is slower than Binet's formula for a single term, but it never drifts. Every ratio it produces, no matter how far along the sequence, reflects the true mathematical relationship between consecutive Fibonacci numbers and their steady march toward φ.

The sum shortcut

Adding the first n Fibonacci terms by hand looks tedious, but a clean shortcut exists: the sum of the first n terms equals F(n+2) minus 1. In symbols, that is sum = F(n+2) − 1. This identity turns a long running total into a single lookup, which is exactly how a well-built fibonacci calculator should handle cumulative sums internally.

The rule is easy to check against the sequence itself. The Fibonacci sequence starts 0, 1 and each term is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on. Verified values include F(10) = 55, F(20) = 6,765, and F(30) = 832,040. As a self-check on the arithmetic, the first 20 terms sum to 17,710, which matches the identity sum = F(n+2) − 1 = F(22) − 1. If your tool returns anything other than 17,710 for that case, the addition logic is wrong.

Why does this matter for implementation? Terms grow exponentially — F(100) has 21 digits — so exact values need arbitrary-precision (BigInt) arithmetic rather than ordinary floating point. A naive loop that adds terms one by one will stay exact as long as each term is exact, but it still does O(n) work. Applying the shortcut means you compute one term, F(n+2), and subtract 1, which is far cheaper when n is large and the result is still exact if the underlying arithmetic is exact.

Binet's formula gives F(n) directly from φ, but rounding errors make it unreliable for large n. The golden ratio approximation is striking: F(30)/F(29) = 1.618034, matching φ to six decimal places. That convergence is beautiful, but it is also a warning. If a ratio that accurate can still produce wrong integers after enough steps, the sum shortcut combined with iterative exact addition is the safer path. Iterative exact addition never drifts, and pairing it with the sum identity keeps both speed and precision intact.

Self-check: the first 20 terms sum to 17,710, matching F(22) − 1. Use this case to verify any fibonacci calculator before trusting larger results.

Why exact arithmetic matters

The Fibonacci sequence starts 0, 1 and each term is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34… That pattern is simple enough, but the numbers grow at an exponential rate. By the time you reach F(100), the value has 21 digits. Ordinary floating-point arithmetic cannot keep up with that growth without losing information, which is why a reliable fibonacci calculator needs a different approach.

Standard double-precision numbers lose integer precision past 2^53, which falls near F(78). Beyond that threshold, the least significant digits become unreliable, and the calculator begins returning values that look reasonable but are actually wrong in the final digits. For small terms the problem is invisible — F(10) = 55, F(20) = 6,765, and F(30) = 832,040 all fit comfortably within a double. But as the terms climb, the errors compound and silently corrupt the results.

BigInt arithmetic solves this by keeping every digit, no matter how large the term becomes. This calculator works using arbitrary-precision addition, so F(100) and far beyond are computed exactly, digit for digit, with no rounding and no lost precision. The same exactness preserves the identities that make the Fibonacci sequence useful. The first 20 terms sum to 17,710, matching the identity sum = F(n+2) − 1 = F(22) − 1. Likewise, F(30)/F(29) = 1.618034, matching the golden ratio φ to six decimal places. These relationships hold only when every term is exact.

Binet's formula offers a tempting shortcut by giving F(n) directly from φ, but rounding errors make it unreliable for large n. The formula depends on irrational numbers and exponentiation, both of which introduce floating-point approximations that drift away from the true integer value as n increases. Iterative exact addition never drifts. Each term is built from the two before it using whole-number arithmetic, so the result is always the correct Fibonacci number — not an approximation that happens to look like one.

Double-precision arithmetic loses integer precision past 2^53, near F(78). This fibonacci calculator uses BigInt instead, so every digit stays exact — even for terms with dozens of digits.

Where Fibonacci numbers show up

Fibonacci numbers appear throughout mathematics and the natural world, and a fibonacci calculator is often the fastest way to explore these connections. One of the best-known examples is phyllotaxis, the arrangement of leaves, seeds, and petals in plants. Sunflower spirals are the classic case: the seeds packed into the center of a sunflower head typically form two sets of spirals curving in opposite directions, and the counts of those spirals are frequently consecutive Fibonacci numbers such as 21 and 34 or 34 and 55. This pattern reflects an efficient packing strategy — angles close to the golden ratio keep successive seeds from lining up, maximizing space — but not every sunflower follows the pattern perfectly, and counts that are not Fibonacci numbers do show up in real fields.

In pure mathematics, the Fibonacci sequence surfaces in a surprising corner of number theory: the Euclidean algorithm for finding the greatest common divisor. The algorithm's worst-case input, meaning the pair of numbers that forces the most division steps relative to their size, is always two consecutive Fibonacci numbers. If you run the Euclidean algorithm on F(n+1) and F(n), it takes roughly n steps to finish, and no smaller pair of inputs produces a longer chain. This is one reason the sequence matters beyond its visual appeal — it sets a concrete performance bound for one of the oldest algorithms still in regular use.

A third appearance comes through Zeckendorf representation, a theorem stating that every positive integer can be written uniquely as a sum of non-consecutive Fibonacci numbers. For example, 100 equals 89 + 8 + 3, and no other combination of non-consecutive Fibonacci terms adds to 100. This property gives the sequence a role in combinatorics and number representation similar in spirit to binary expansion, and it is the basis for several efficient computational techniques involving Fibonacci-coded data structures.

  • The sequence starts 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, with each term equal to the sum of the previous two.
  • Verified values include F(10) = 55, F(20) = 6,765, and F(30) = 832,040.
  • The first 20 terms sum to 17,710, matching the identity sum = F(n+2) − 1 = F(22) − 1.
  • The ratio F(30)/F(29) equals 1.618034, matching the golden ratio φ to six decimal places.
  • Because terms grow exponentially — F(100) already has 21 digits — exact computation for large n requires arbitrary-precision arithmetic rather than ordinary floating point.
  • Binet's formula derives F(n) directly from φ, but rounding errors make it unreliable for large n; iterative exact addition never drifts.
Pop-culture claims often overstate Fibonacci's reach. Not every spiral in nature follows the sequence, and not every proportion in art or architecture matches the golden ratio. The verified mathematical appearances — phyllotaxis, the Euclidean algorithm's worst case, and Zeckendorf representation — are striking enough on their own without the exaggeration.

FAQs

What is the 20th Fibonacci number?

The 20th Fibonacci number is F(20) = 6,765, counting F(0) = 0 and F(1) = 1. This indexing convention starts the sequence at zero, so the 20th term lands on 6,765. If a source instead starts with F(1) = 1 and F(2) = 1, its 20th value will differ by one position.

What is F(30)?

F(30) = 832,040. By this point the ratio F(30)/F(29) already equals 1.618034, which is the golden ratio to six decimals. This convergence happens because each successive term is roughly 1.618 times the previous one, so the ratio stabilizes quickly and stays remarkably consistent as n grows larger.

How do you sum the first n Fibonacci numbers quickly?

The sum of F(1) through F(n) equals F(n+2) − 1. For n = 20, that gives F(22) − 1 = 17,711 − 1 = 17,710. This shortcut avoids adding every term individually. Just look up or calculate the Fibonacci number two positions beyond n, then subtract one to get the total.

Does the sequence start 0, 1 or 1, 1?

Both conventions exist. This calculator uses F(0) = 0, F(1) = 1, so the sequence runs 0, 1, 1, 2, 3, 5… Always check which indexing a source uses before comparing values. The two-starting-point difference shifts every position by one, which can cause mismatches when cross-referencing results from different references.

How big does F(100) get?

F(100) = 354,224,848,179,261,915,075 — 21 digits, far beyond exact floating-point integers. That is why exact BigInt arithmetic is used instead of standard floating-point math. Without BigInt, such large values lose precision and round incorrectly. BigInt handles arbitrarily large integers, so every digit of F(100) remains exact and reliable.

What is Binet's formula?

Binet's formula is a closed form: F(n) = (φ^n − ψ^n)/√5. It is elegant, but floating-point rounding makes it drift for large n, so exact iteration is safer. The formula uses the golden ratio φ and its conjugate ψ, but numerical errors accumulate. For exact results, especially with large n, iterative calculation avoids these rounding problems.

Sources

Related calculators

Exponent Calculator
Any base to any power — whole, negative and fractional exponents — with squares and cubes for reference.
Geometric Series Sum Calculator
The sum of the first n terms of a geometric series, the nth term itself, and the infinite sum when |r| < 1 — the formula behind perpetuities and loan mathematics.
Factorial Calculator
Exact factorials up to 170! computed with arbitrary-precision integers — no scientific-notation rounding — with the digit count and trailing zeros (Legendre's formula) explained.