๐Ÿ‡บ๐Ÿ‡ธ USC
Math
๐ŸŒ€

Fibonacci Calculator

Generate the Fibonacci sequence and find the nth Fibonacci number

โœ…

Last updated June 15, 2026

Method: Terms are generated by the standard recurrence F(n) = F(nโˆ’1) + F(nโˆ’2) with seeds F(0) = 0 and F(1) = 1, using exact integer (big-number) arithmetic so even large terms are precise.

Included: The Fibonacci sequence up to N terms, the nth Fibonacci number, the sum of the listed terms, the ratio of the last two terms, and the golden-ratio relationship. Choice of 0-indexed or 1-indexed start.

Not included: Negative-index ("negafibonacci") terms, Lucas numbers, and other related integer sequences. The calculator is capped at 1,000 terms for performance.

๐ŸŒ€ Fibonacci settings

Start the sequence at

๐ŸŽฏ The 20th Fibonacci number

6,765
F(20)
Sum of shown terms
986
Last ratio F(n)/F(nโˆ’1)
1.618026

Using the zero-indexed convention F(0) = 0, F(1) = 1, F(n) = F(nโˆ’1) + F(nโˆ’2).

๐ŸŒ€ Fibonacci sequence (15 terms)

F00F11F21F32F43F55F68F713F821F934F1055F1189F12144F13233F14377

๐Ÿ“Š Summary

Terms shown
15
First index
F(0)
Sum of shown terms
986
Last ratio F(n)/F(nโˆ’1)
1.618026
โœจ Golden ratio

The ratio of consecutive Fibonacci numbers approaches the golden ratio ฯ† โ‰ˆ 1.618034 as the terms grow.

Exact integer arithmetic. Sequence uses F(0) = 0, F(1) = 1, F(n) = F(nโˆ’1) + F(nโˆ’2). Capped at 1,000 terms for performance.

Fibonacci calculator: the sequence, the nth term, and the golden ratio

A Fibonacci calculator generates the Fibonacci sequence โ€” 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 โ€” where each number equals the sum of the two before it, and returns any nth Fibonacci number directly. For example, the 10th Fibonacci number (zero-indexed) is F(10) = 55. This tool builds terms with exact integer math, so even F(1000) โ€” a 209-digit number โ€” comes out precise.

Working with everyday percentages instead of a number sequence? Reach for the Percentage Calculator for "what is X% of Y", the Percentage Increase Calculator for growth between two figures, the Percentage Change Calculator for a rise or fall as a signed percent, and the Discount Calculator for sale prices โ€” this page is strictly for the Fibonacci integer sequence and its golden-ratio behavior.

The formula behind the sequence

Every term in the sequence comes from one short recurrence rule:

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

In words: to get the next number, add the previous two. The two "seed" values F(0) = 0 and F(1) = 1 get the sequence started. There is also a remarkable closed-form expression, known as Binet's formula, that produces the nth term without building all the earlier ones:

F(n) = (φn − ψn) ÷ √5

where φ (phi) = (1 + √5)/2 ≈ 1.6180339887 is the golden ratio and ψ (psi) = (1 − √5)/2 ≈ −0.6180339887. Because ψn quickly shrinks toward zero, F(n) is extremely close to φn ÷ √5, and you can recover the exact integer by rounding. This calculator uses the recurrence with exact integer math rather than the floating-point Binet formula, so the answers stay precise for every term.

A worked example: finding F(10)

Suppose you want the 10th Fibonacci number using the zero-indexed convention. You build the list step by step, each time adding the previous two:

F(0) = 0
F(1) = 1
F(2) = 1 + 0 = 1
F(3) = 1 + 1 = 2
F(4) = 2 + 1 = 3
F(5) = 3 + 2 = 5
F(6) = 5 + 3 = 8
F(7) = 8 + 5 = 13
F(8) = 13 + 8 = 21
F(9) = 21 + 13 = 34
F(10) = 34 + 21 = 55

So F(10) = 55. Notice the ratio of consecutive terms is already homing in on the golden ratio: 34/21 ≈ 1.6190 and 55/34 ≈ 1.6176, both close to φ ≈ 1.6180. The further you go, the tighter that ratio gets โ€” that is the headline relationship between Fibonacci numbers and the golden ratio.

Fibonacci sequence chart: the first 20 terms

This reference table lists every Fibonacci number from F(0) through F(20), the running sum of all terms up to that point, and the ratio to the previous term. The two index columns show why "the 7th Fibonacci number" can mean 8 or 13 depending on whether you count from 0 or from 1.

Index n (from 0) Term # (from 1) F value Sum F(0)โ€ฆF(n) Ratio F(n)/F(n−1)
01st00
12nd11
23rd121.000000
34th242.000000
45th371.500000
56th5121.666667
67th8201.600000
78th13331.625000
89th21541.615385
910th34881.619048
1011th551431.617647
1112th892321.618182
1213th1443761.617978
1314th2336091.618056
1415th3779861.618026
1516th6101,5961.618037
1617th9872,5831.618033
1718th1,5974,1801.618034
1819th2,5846,7641.618034
1920th4,18110,9451.618034
2021st6,76517,7101.618034

The running sum confirms the identity F(0) + โ€ฆ + F(n) = F(n+2) − 1: for n = 10 the sum is 143, and F(12) − 1 = 144 − 1 = 143.

How to use this Fibonacci calculator

Three inputs control everything, and the result updates as soon as you generate it:

  1. Number of terms: how many values of the sequence to list out (for example, 15 gives the first fifteen terms).
  2. nth term: the single position n whose Fibonacci number you want returned on its own โ€” handy when you only need F(50) and do not want to scan a long list.
  3. Start the sequence at: choose F(0) = 0 (zero-indexed, the standard math convention) or F(1) = 1 (one-indexed, common in textbooks and puzzles).

Press Generate sequence and the calculator shows the listed terms, the nth Fibonacci number, the sum of the listed terms, and the ratio of the final two terms so you can watch it converge on φ.

Who this calculator is for

The Fibonacci calculator is useful for a wide range of people:

  • Students checking homework on sequences, recurrences, and the golden ratio.
  • Teachers generating example sequences and sums quickly for a lesson or worksheet.
  • Programmers verifying the output of a recursive or iterative Fibonacci function, including for large n where overflow matters.
  • Puzzle and trivia fans who want an exact F(n) without doing the long addition by hand.
  • Designers and hobbyists curious about the golden ratio and where Fibonacci numbers appear in spirals and proportions.

Zero-indexed vs one-indexed: why the labels differ

One common source of confusion is whether the sequence "starts" at 0 or 1. The values are identical either way; only the index labels shift. In the zero-indexed convention, F(0) = 0, F(1) = 1, F(2) = 1, F(3) = 2, and so on. In the one-indexed convention, F(1) = 1, F(2) = 1, F(3) = 2. So "the 7th Fibonacci number" is F(7) = 13 if you count from index 0, but the 7th term written out (1, 1, 2, 3, 5, 8, 13) is also 13 when you count from index 1 โ€” the off-by-one is in the label, not the value. Because that single index assumption can change which number you read off, this calculator makes the convention explicit and lets you pick the one your assignment or reference uses.

Key terms explained

  • Recurrence relation: a rule that defines each term from earlier ones โ€” here, "add the previous two."
  • Seed values: the starting numbers (0 and 1) that the recurrence needs before it can produce anything.
  • nth term: the Fibonacci number at position n, written F(n).
  • Golden ratio (φ): the constant (1 + √5)/2 ≈ 1.618 that the ratio of consecutive Fibonacci numbers converges to.
  • Binet's formula: the closed-form expression for F(n) using φ and ψ.
  • Big-number arithmetic: exact integer math that handles numbers with hundreds of digits, which ordinary floating-point cannot represent precisely.

Patterns and identities worth knowing

The Fibonacci numbers hide a surprising number of clean identities. A few you can verify with this calculator:

  • Sum of the first terms: F(0) + F(1) + โ€ฆ + F(n) = F(n+2) − 1. For example, 0 + 1 + 1 + 2 + 3 + 5 = 12 = F(7) − 1.
  • Every third number is even: 0, 2, 8, 34, 144 โ€ฆ โ€” the rest are odd, in a strict pattern.
  • Consecutive terms share no common factor: gcd(F(n), F(n+1)) = 1, so neighboring Fibonacci numbers are always coprime.
  • Ratio converges to φ: F(n+1) / F(n) approaches the golden ratio as n grows, alternating just above and just below it.
  • Sum of squares: F(1)² + F(2)² + โ€ฆ + F(n)² = F(n) × F(n+1).

How Fibonacci ratios converge to the golden ratio

Dividing each Fibonacci number by the one before it produces a sequence that zig-zags above and below the golden ratio φ = 1.6180339887, closing in fast. This table shows the ratio and its signed error from φ at each step.

Ratio Value Error vs φ
F(2)/F(1) = 1/11.00000000−0.61803399
F(3)/F(2) = 2/12.00000000+0.38196601
F(4)/F(3) = 3/21.50000000−0.11803399
F(5)/F(4) = 5/31.66666667+0.04863268
F(6)/F(5) = 8/51.60000000−0.01803399
F(7)/F(6) = 13/81.62500000+0.00696601
F(8)/F(7) = 21/131.61538462−0.00264937
F(9)/F(8) = 34/211.61904762+0.00101363
F(11)/F(10) = 89/551.61818182+0.00014783
F(16)/F(15) = 987/6101.61803279−0.00000120
F(21)/F(20) = 10946/67651.61803400+0.00000001

By the 21st ratio the error is down to one part in 100 million, and the sign flips at every step โ€” the hallmark of Fibonacci convergence to φ.

Computing Fibonacci numbers: three ways

There is more than one route to F(n), and the right one depends on how big n is:

  • Naive recursion โ€” calling fib(n) = fib(n−1) + fib(n−2) directly. Simple to write, but it recomputes the same values exponentially many times and becomes unusably slow past about n = 40.
  • Iteration (or memoization) โ€” keep the last two values and loop forward. This runs in linear time and is what this calculator uses, plus exact big-number addition so large terms stay precise.
  • Fast doubling / matrix power โ€” uses identities like F(2k) = F(k) × (2F(k+1) − F(k)) to reach F(n) in roughly log(n) steps, the method of choice for enormous n.

If you are writing code, remember that F(n) outgrows a 64-bit integer around F(92), so anything larger needs big-integer support โ€” exactly the kind of overflow this calculator avoids.

What is the nth Fibonacci number? Milestone values

These are exact zero-indexed Fibonacci numbers at popular positions, with a digit count so you can see how fast they grow. Large values are shown truncated; the calculator returns every digit in full.

n F(n) Digits
10552
206,7654
2575,0255
30832,0406
40102,334,1559
5012,586,269,02511
601,548,008,755,92013
752,111,485,077,978,05016
100354,224,848,179,261,915,07521
20028057โ€ฆ952542
50013942โ€ฆ4125105
100043466โ€ฆ8875209

Digit count grows by roughly log₁₀(φ) ≈ 0.209 per term, so F(n) has about n × 0.209 + 1 digits โ€” F(100) lands at 21 digits, F(1000) at 209.

Where Fibonacci shows up

Beyond the classroom, Fibonacci numbers and the golden ratio appear in many places. In nature, the spirals of sunflower seeds, pinecones, and pineapples often follow Fibonacci counts, and leaves frequently arrange around a stem in Fibonacci-related angles to capture light efficiently. In computer science, Fibonacci numbers underpin the Fibonacci heap data structure and appear in algorithm analysis. In finance, traders draw "Fibonacci retracement" levels, though that use is a heuristic rather than a mathematical law. It is worth a healthy dose of skepticism: popular media often over-claims Fibonacci sightings, attaching the sequence to designs or shells that only loosely fit. The genuine, provable connection is the convergence of consecutive ratios to the golden ratio โ€” the rest ranges from real to coincidental.

Tips for getting the answer you want

  • Match the index convention to your textbook or assignment before you trust an F(n) value โ€” the off-by-one trips people up constantly.
  • Use the nth-term field when you only need one number; you do not have to list a thousand terms to read F(500).
  • Watch the ratio at the bottom: with enough terms it should read 1.618034, confirming convergence to φ.
  • Cross-check identities like the sum formula F(n+2) − 1 using the sum the calculator reports.

Limitations and assumptions

  • The sequence is capped at 1,000 terms to keep the page responsive; that is far more than most uses require (F(1000) already has 209 digits).
  • It computes the standard Fibonacci sequence with seeds 0 and 1. It does not handle custom seeds, Lucas numbers, or negative-index "negafibonacci" terms.
  • The displayed ratio uses ordinary floating-point division of the last two terms, so it shows about six accurate decimals; the sequence values themselves are exact integers.
  • This is an educational tool for the integer sequence, not a statement about any real-world claim that "follows Fibonacci."

Related math calculators

If your question is a little different, a sister tool may fit better:

About this formula

The Fibonacci sequence is a standard, well-established mathematical definition โ€” F(n) = F(nโˆ’1) + F(nโˆ’2) with F(0) = 0 and F(1) = 1 โ€” so the results here are deterministic and need no external data source. The closed-form Binet expression and the convergence of consecutive ratios to the golden ratio φ = (1 + √5)/2 are classical results that follow directly from that recurrence. Because no legal, tax, or measured figures are involved, there are no primary sources to cite; the math itself is the authority.

โš ๏ธ Common mistakes & edge cases

Mixing up the index convention

Ask for "the 6th Fibonacci number" and you can get two answers. Zero-indexed, the labels are F(0) = 0, F(1) = 1, F(2) = 1, F(3) = 2, F(4) = 3, F(5) = 5, F(6) = 8, so F(6) = 8. But if you instead count positions in 0, 1, 1, 2, 3, 5, 8 starting the count at the leading 0, the 6th item you land on is 5. Decide whether you are labeling by index F(n) or counting positions before reading off your answer.

Integer overflow in code

F(n) exceeds a signed 64-bit integer around F(92). A program that quietly overflows returns wrong, sometimes negative, values. Use big-integer types for large n โ€” this calculator does the exact math for you.

Trusting floating-point Binet for large n

The closed-form φn ÷ √5 is exact in theory but rounding error in floating-point makes it drift for large n. Rounding works for modest n; for big values, stick to exact integer addition.

Over-claiming Fibonacci in nature

Some "Fibonacci spirals" in design or shells are approximations or coincidences, not exact matches. The provable fact is that consecutive ratios converge to the golden ratio โ€” be cautious with broader claims.

Note: This is an educational math tool. It computes the standard integer Fibonacci sequence; it does not validate real-world "golden ratio" claims.

❓ Frequently asked questions

What is the Fibonacci sequence?

The Fibonacci sequence is a list of numbers where each term is the sum of the two before it. Starting from 0 and 1, the sequence runs 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, and so on. The rule is F(n) = F(nโˆ’1) + F(nโˆ’2), with the seed values F(0) = 0 and F(1) = 1. It is named after Leonardo of Pisa, known as Fibonacci, who described it in 1202.

How do I use this Fibonacci calculator?

Enter how many terms you want in the 'Number of terms' field, type the position n for the single Fibonacci number you want in the 'nth term' field, and choose whether the sequence starts at F(0) = 0 or F(1) = 1. Press Generate sequence and the calculator lists the terms, shows the nth Fibonacci number, the sum of the listed terms, and the ratio of the last two terms (which approaches the golden ratio).

How do you find the nth Fibonacci number?

The direct way is to start with 0 and 1 and repeatedly add the last two numbers until you reach position n. For example, to find F(7) you build 0, 1, 1, 2, 3, 5, 8, 13, so F(7) = 13. There is also a closed-form 'Binet' formula, F(n) = (ฯ†^n โˆ’ ฯˆ^n) / โˆš5, where ฯ† = (1 + โˆš5)/2 โ‰ˆ 1.618 and ฯˆ = (1 โˆ’ โˆš5)/2 โ‰ˆ โˆ’0.618. This calculator uses exact integer addition so the answer is exact even for very large n.

Does the sequence start at 0 or 1?

Both conventions are common. The most standard mathematical definition starts at F(0) = 0, giving 0, 1, 1, 2, 3, 5. Many textbooks and puzzles instead start at F(1) = 1, giving 1, 1, 2, 3, 5, 8. The numbers are the same; only the index labels shift by one. This calculator lets you pick either starting point.

What is the golden ratio and how is it related to Fibonacci?

The golden ratio, written ฯ† (phi), equals (1 + โˆš5)/2 โ‰ˆ 1.6180339887. As you go further along the Fibonacci sequence, the ratio of each number to the one before it gets closer and closer to ฯ†. For instance 13/8 = 1.625, 21/13 โ‰ˆ 1.6154, and 144/89 โ‰ˆ 1.6180. The calculator shows this last ratio so you can watch it converge.

Is there a formula for the Fibonacci sequence?

Yes. The recursive formula is F(n) = F(nโˆ’1) + F(nโˆ’2) with F(0) = 0 and F(1) = 1. The closed-form Binet formula is F(n) = (ฯ†^n โˆ’ ฯˆ^n) / โˆš5. Because ฯˆ^n shrinks toward zero, you can also compute F(n) by rounding ฯ†^n / โˆš5 to the nearest whole number for n of about 1 or more.

How large a Fibonacci number can this calculator handle?

The calculator builds the sequence with exact integer (big-number) arithmetic and is capped at 1,000 terms for performance. Even F(1000) has 209 digits, far beyond what ordinary floating-point math can represent exactly, and the calculator returns it precisely rather than as an approximation.

What is the sum of the first n Fibonacci numbers?

The sum of the Fibonacci numbers from F(0) through F(n) equals F(n+2) โˆ’ 1. For example, 0 + 1 + 1 + 2 + 3 + 5 = 12, and F(7) โˆ’ 1 = 13 โˆ’ 1 = 12. The calculator adds up exactly the terms you choose to display, so you can verify this identity yourself.

Where does the Fibonacci sequence appear in nature?

Fibonacci numbers show up in the arrangement of leaves around a stem, the spirals of sunflower seed heads and pinecones, the branching of some trees, and the family tree of honeybees. These patterns relate to the golden ratio, which packs elements efficiently. The connection is real but often exaggerated in popular media, so treat sweeping claims with care.

What is the 100th Fibonacci number?

Using the zero-indexed convention, F(100) = 354,224,848,179,261,915,075 โ€” a 21-digit number. If you count from F(1) = 1 instead, that same value is the 101st term. This calculator returns it exactly using big-number arithmetic, whereas ordinary 64-bit integers overflow around F(92) and floating-point Binet drifts by this point.

What are the first 20 Fibonacci numbers?

Zero-indexed from F(0), the first 20 Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, with F(20) = 6765 as the 21st. Their running sum through F(20) is 17,710, matching the identity F(0) + โ€ฆ + F(n) = F(n+2) โˆ’ 1.

Is this Fibonacci calculator free?

Yes. This Fibonacci calculator is completely free with no sign-up and no limit on how many sequences you generate. Change the number of terms, the nth position, or the starting index as often as you like to explore the pattern.

๐Ÿ’ก Good to know

The ratio converges, alternating around φ

F(n+1)/F(n) overshoots and undershoots the golden ratio in turn โ€” 1.5, 1.667, 1.6, 1.625, 1.6154 โ€” closing in on 1.6180339887 from both sides.

Fibonacci numbers grow exponentially

Roughly, F(n) is about φn ÷ √5, so each term is about 1.618 times the last. F(100) already has 21 digits, and F(1000) has 209.

Neighbors are always coprime

Two consecutive Fibonacci numbers never share a common factor greater than 1, a tidy property that links the sequence to the Euclidean algorithm.

Related Calculators