Fibonacci Calculator - nth Term, Sum, and Golden Ratio

Use the fibonacci calculator to find the nth Fibonacci number, full term list, sum of the first n terms, and the golden ratio cross-check.

Updated: June 16, 2026 • Free Tool

Fibonacci Calculator

Positive integer; computes F(n) using the 1-indexed convention by default.

Both conventions give the same numbers from F(1) onward; the zero-indexed list starts with 0.

Results

nth Fibonacci term (F(n))
0
Sum of the first n terms 0
Consecutive ratio F(n) / F(n-1) 0
Binet's closed-form F(n) 0
Golden ratio phi (reference) 0
First n Fibonacci terms 0

What Is the Fibonacci Calculator?

A fibonacci calculator is a tool that reads a positive integer n and returns the nth Fibonacci number, the full term list, the sum of the first n terms, and the consecutive ratio that approaches the golden ratio. It is meant for students, programmers, and anyone who needs an exact Fibonacci value with a closed-form cross-check.

  • Find the nth Fibonacci number: Type n and read F(n) directly instead of hand-walking a recurrence.
  • Generate a clean term list: Print F(1) through F(n) as a comma-separated list you can paste into notes.
  • Sum the first n Fibonacci terms: Read the running total of the first n terms, equal to F(n+2) - 1.
  • See the golden ratio converge: Compare the consecutive ratio F(n) / F(n - 1) against phi to see the limit in action.

The Fibonacci sequence is the most famous recursive sequence in school math. Every term after the first two is the sum of the two previous terms, so the sequence is fully determined by its seed values. The calculator does the recurrence in your browser and prints a Binet result next to the iterative result so you can see they agree.

For a sequence that adds a fixed step instead of a recursive sum, the Arithmetic Sequence Calculator handles the arithmetic progression case with the same n, a1, d inputs.

How the Fibonacci Calculator Works

The calculator runs the recurrence F(n) = F(n - 1) + F(n - 2) iteratively and prints the closed-form Binet's formula result next to it as a cross-check. The seed values are 1 and 1 for the 1-indexed convention or 0 and 1 for the 0-indexed convention.

F(n) = F(n - 1) + F(n - 2), phi = (1 + sqrt(5)) / 2, Binet: F(n) = (phi^n - psi^n) / sqrt(5)
  • n: Index of the term to compute. Must be a positive integer; the calculator accepts n from 1 to 1000.
  • F(1), F(2): Seed values, equal to 1 and 1 in the 1-indexed convention used by default.
  • phi: Golden ratio (1 + sqrt(5)) / 2, approximately 1.6180339887498949.
  • psi: Conjugate root (1 - sqrt(5)) / 2, approximately -0.6180339887498949.
  • F(n): The nth Fibonacci number; the primary output of the calculator.

The iterative result and the Binet result run in parallel so any disagreement surfaces immediately. The iterative path uses standard JavaScript numbers for small n and integer accumulation for the running sum to keep the total exact, while the Binet path uses phi and psi to fifteen decimals and rounds at the end.

n = 10 with the 1-indexed convention

n = 10, starting convention = F(1) = 1, F(2) = 1

Build 1, 1, 2, 3, 5, 8, 13, 21, 34, 55. Binet: (phi^10 - psi^10) / sqrt(5) = 55.00, which rounds to 55.

F(10) = 55, sum of the first 10 terms = 143, consecutive ratio 55 / 34 = 1.6176470588235294

The 10th Fibonacci number is 55 and the running total is 143, which matches F(12) - 1 = 144 - 1 = 143 from the closed-form sum identity.

n = 20 with the 1-indexed convention

n = 20, starting convention = F(1) = 1, F(2) = 1

Build the list up to 6765. Binet: (phi^20 - psi^20) / sqrt(5) = 6765.00, which rounds to 6765.

F(20) = 6765, sum of the first 20 terms = 17710, consecutive ratio 6765 / 4181 = 1.6180339631667064

By n = 20 the consecutive ratio is within 0.0001% of the golden ratio, the limit Khan Academy highlights for the sequence.

According to Wolfram MathWorld, the Fibonacci numbers are defined by the recurrence F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1, and Binet's closed form is F(n) = (phi^n - psi^n) / sqrt(5).

The Binet cross-check uses the same kind of closed-form trick you see in n! in the Factorial Calculator, which reduces a recursive product to a single expression.

Key Concepts Explained

Four ideas cover every output the calculator prints and every choice the user can make in the form.

The recurrence F(n) = F(n - 1) + F(n - 2)

Every term after the first two is the sum of the two previous terms. The recurrence is the whole definition; the closed-form Binet expression is a derived identity, not a separate sequence.

Starting convention (1-indexed vs 0-indexed)

Most textbooks use F(0) = 0, F(1) = 1, which makes F(1) = 1. A few sources start at F(1) = 1, F(2) = 1. The numbers from F(1) onward are identical, so the choice only affects labeling.

Binet's closed form

F(n) = (phi^n - psi^n) / sqrt(5) gives the same integer for any positive n as the iterative recurrence. It is useful as a cross-check, although standard double precision starts to lose accuracy past n = 70.

The golden ratio limit

The ratio of consecutive Fibonacci numbers approaches phi = (1 + sqrt(5)) / 2, which is approximately 1.6180339887498949. The consecutive ratio row makes the convergence visible without writing out dozens of terms.

The recurrence is the smallest possible definition of a non-trivial integer sequence, which is why it shows up in textbooks, coding interviews, and biology discussions of plant growth patterns. The golden ratio is a by-product of the recurrence, not a separate input: once the calculator prints the consecutive ratio, you can read it against the reference phi row to see how close the sequence is to the limit at the chosen n.

When you want to compare two general numbers as a ratio, the Ratio Calculator handles the same divide-and-simplify workflow without assuming the numerator is a Fibonacci number.

How to Use This Calculator

Five short steps cover every workflow the calculator supports, from a homework problem to a quick golden-ratio sanity check.

  1. 1 Type the index n: Enter the positive integer whose Fibonacci value you want. The default n = 10 prints the classic 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 list.
  2. 2 Pick the starting convention: Choose the 1-indexed seed (F(1) = 1, F(2) = 1) for the textbook list, or the 0-indexed seed (F(0) = 0, F(1) = 1) for a leading zero.
  3. 3 Read the nth term and the Binet cross-check: The F(n) row is the iterative result; the Binet row is the same value in closed form.
  4. 4 Scan the term list and the sum: The term list is capped at the first 50 terms, and the sum row is the running total, equal to F(n + 2) - 1.
  5. 5 Compare the consecutive ratio to phi: The F(n) / F(n - 1) row shows how close the last two terms are to the golden ratio. By n = 20 the ratio is within 0.0001% of phi.

Practical example - a coding-interview sanity check: you have just written a recursive function that returns Fibonacci(n) and want to know it works. Type n = 10 with the 1-indexed seed. The F(n) row should print 55, the term list should end with 55, the sum row should print 143, and the Binet row should also print 55.

When the Fibonacci terms are the side lengths of nested squares, the Spiral Length Calculator computes the arc length of the spiral that runs through them.

Benefits of Using This Calculator

The calculator removes the most common Fibonacci mistakes and saves the step of looking up the closed-form identities in a textbook.

  • Iterative and closed-form in one pass: The F(n) row and the Binet row print at the same time, so you can verify a recursive function against the closed form.
  • Exact arithmetic for large n: The sum row uses integer accumulation and the nth term is rounded from Binet, so the printed integers stay exact up to n = 1000.
  • Both starting conventions supported: Switching the seed values shifts the printed list and the labeling without changing the numbers from F(1) onward.
  • Golden ratio is shown, not assumed: The consecutive ratio row and the reference phi row put the famous limit on screen so you can read it.
  • Domain errors are explained: If n is 0, negative, or a decimal, the calculator returns a clear message instead of NaN.
  • Pairs with related math tools: The term list is the kind of output a recursive coding exercise prints, and the consecutive ratio is a special case of the ratio calculator.

It is plain JavaScript in the browser, so the fibonacci calculator updates as you type, tolerates both seed conventions, and stays readable even when n is much larger than a hand calculation would handle.

If you want to test whether the printed Fibonacci terms are prime, the Prime Number Checker applies a Miller-Rabin-style check to the same integers.

Factors That Affect Your Results

Three inputs change what the calculator prints, plus two practical caveats about how Binet's formula and the term list behave for large n.

Index n

Sets the size of the printed integer and the term list. Small n gives a manageable list, while n in the hundreds pushes the calculator into arbitrary precision to keep F(n) and the sum exact.

Starting convention

Shifts whether the printed list starts at 1 or 0 and changes the label F(0) vs F(1) for the first term. The numbers from F(1) onward are identical, so the choice affects presentation, not the values.

Binet precision

The Binet row uses standard double precision for phi, psi, and the powers. The closed form rounds to the nearest integer, which matches the iterative F(n) for n up to about 70. Beyond that, the iterative row stays exact.

  • Binet's formula uses standard IEEE 754 double precision in this browser, so the closed-form row is only exact up to about n = 70. The iterative F(n) row and the sum row stay exact up to n = 1000 because they use integer arithmetic.
  • The visible term list is capped at 50 terms to keep the result panel readable. The exact nth term and the sum of the first n terms are still computed for larger n, but a list of 200 integers would dominate the page.

The starting convention is a presentation choice that does not change the values, so use the convention that matches the textbook or the coding exercise you are working through. For most school and coding tasks, n stays well under 70 and Binet is exact; when n is larger, treat the Binet row as a sanity check rounded to the nearest integer and trust the iterative F(n) row for the exact value.

According to Wikipedia (Fibonacci sequence), the sum of the first n Fibonacci numbers equals F(n+2) - 1, and the ratio of consecutive Fibonacci numbers approaches the golden ratio phi as n grows.

When you want to see the same recursive structure for binary strings, the Binary Operations Calculator applies a recursive definition to a different data type.

fibonacci calculator showing the nth term, term list, sum, and golden ratio for a typed-in index n
fibonacci calculator showing the nth term, term list, sum, and golden ratio for a typed-in index n

Frequently Asked Questions

Q: What is the Fibonacci sequence?

A: The Fibonacci sequence is the integer sequence where every term after the first two is the sum of the two previous terms. The most common starting convention is F(0) = 0 and F(1) = 1, which gives 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, and so on. The 1-indexed convention used here starts at F(1) = 1, F(2) = 1.

Q: How do you calculate the nth Fibonacci number?

A: Compute it iteratively with F(1) = 1, F(2) = 1, and F(n) = F(n - 1) + F(n - 2) for n >= 3, or use Binet's closed form F(n) = (phi^n - psi^n) / sqrt(5), where phi = (1 + sqrt(5)) / 2. This calculator runs both and prints them side by side.

Q: Does the Fibonacci sequence start with 0 or 1?

A: Both conventions are used. The 0-indexed convention is F(0) = 0, F(1) = 1, while the 1-indexed convention is F(1) = 1, F(2) = 1. The actual numbers from F(1) onward are identical, so the choice is about labeling rather than values.

Q: What is the formula for the sum of the first n Fibonacci numbers?

A: The sum of the first n Fibonacci numbers equals F(n+2) - 1. For n = 10 the sum is 1 + 1 + 2 + 3 + 5 + 8 + 13 + 21 + 34 + 55 = 143, which is F(12) - 1 = 144 - 1 = 143. The calculator prints this in the sum row.

Q: What is the golden ratio and how does it connect to the Fibonacci sequence?

A: The golden ratio is phi = (1 + sqrt(5)) / 2, which is approximately 1.6180339887498949. The ratio of consecutive Fibonacci numbers F(n + 1) / F(n) approaches phi as n grows, so by n = 20 the ratio is within 0.0001% of the limit.

Q: How accurate is Binet's formula for large n?

A: Binet's formula is mathematically exact, but the printed integer matches the true F(n) up to about n = 70 in the browser's standard double precision. For larger n, the iterative F(n) row stays exact, and the Binet row is still useful as a cross-check rounded to the nearest integer.