Fibonacci Sequence Generator

Generate a Fibonacci sequence of up to 100 terms, with its sum.

Enter the number of terms you want to generate. See the complete Fibonacci sequence and the sum of all terms.

Updated June 2026 · How this works

Put this calculator on your site

Free embed code. Works anywhere. No signup.

Worth knowing
How It Works
The formula, explained simply

The Fibonacci sequence generator creates a series where each number equals the sum of the two preceding numbers. Starting with 0 and 1, the sequence builds: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and continues infinitely. This simple rule produces a sequence with remarkable mathematical properties.

When you enter the number of terms, the generator calculates each position systematically. It starts with the first two terms (0, 1), then applies the addition rule repeatedly. For the third term: 0 + 1 = 1. For the fourth: 1 + 1 = 2. For the fifth: 1 + 2 = 3. This pattern continues until reaching your specified length.

The generator also calculates the sum of all terms in your sequence. This sum follows its own pattern: the first n terms, F(0) to F(n−1), add up to F(n+1) − 1. For 8 terms, 0 + 1 + 1 + 2 + 3 + 5 + 8 + 13 = 33 = F(9) − 1. Understanding this relationship helps verify calculations and explore deeper mathematical connections.

Beyond pure mathematics, Fibonacci numbers turn up in some patterns of plant growth. The spiral counts of pine cones and sunflower heads are examples; the spirals of galaxies and hurricanes are logarithmic spirals, not Fibonacci patterns.

When To Use This
Right tool, right situation

Use this Fibonacci sequence generator when analyzing natural patterns like flower petal arrangements, leaf positioning, or spiral formations. Botanists and biologists rely on Fibonacci numbers to understand phyllotaxis (leaf arrangement) and optimal packing in seeds and flowers.

In art and design, some people use the sequence to approximate the golden ratio in a composition. Some architects and graphic designers use Fibonacci proportions in their layouts. Generate sequences to find ratios for your specific design needs.

Financial analysts use Fibonacci retracements in technical analysis, identifying potential support and resistance levels in price charts. Generate the sequence to calculate these levels manually or verify automated trading tool calculations.

Computer science applications include algorithm optimization, data structure design, and recursive function examples. The sequence serves as a benchmark for testing recursive implementations and understanding computational complexity. Programming students often implement Fibonacci generators as exercises in recursion and dynamic programming.

Common Mistakes
Why results sometimes look wrong

A common mistake is starting the sequence with 1, 1 instead of 0, 1. Both conventions exist; this generator begins with F(0) = 0, F(1) = 1. Starting with 1, 1 gives the same numbers shifted by one place, so check which convention your source uses before comparing positions.

Another error involves manually calculating large sequences without checking for integer overflow. Fibonacci numbers grow exponentially: F(79) = 14,472,334,024,676,221 is larger than 2^53, the point where ordinary floating-point numbers (including JavaScript's) stop storing whole numbers exactly. This generator uses exact integer arithmetic, so all 100 terms and their sum are exact.

Many people confuse the Fibonacci sequence with Lucas numbers (2, 1, 3, 4, 7, 11...) or other similar sequences. While related, these follow different starting conditions and produce different results. Always verify you're using the correct initial values for your specific application.

When applying Fibonacci numbers to real-world problems, avoid forcing patterns where none exist. Not every spiral in nature follows Fibonacci proportions, and not every occurrence of these numbers in data represents a meaningful pattern. Use the sequence as a tool for analysis, but verify relationships through additional evidence.

The Math
Worked examples and deeper derivation

The Fibonacci sequence follows the recurrence relation F(n) = F(n-1) + F(n-2), with initial conditions F(0) = 0 and F(1) = 1. This creates an infinite sequence where each term depends on its predecessors. The mathematical beauty emerges from its connection to the golden ratio φ = (1 + √5)/2 ≈ 1.618.

As n increases, the ratio F(n+1)/F(n) converges to φ. Binet's formula gives F(n) exactly as (φⁿ − ψⁿ)/√5, where ψ = (1 − √5)/2. Because ψⁿ shrinks toward zero, rounding φⁿ/√5 to the nearest whole number already gives F(n).

The sequence exhibits fascinating divisibility properties. Every third Fibonacci number is even, every fourth is divisible by 3, every fifth by 5, and every sixth by 8. These patterns make the sequence a standard example in number theory.

Matrix representation provides another perspective: [[1,1],[1,0]]ⁿ produces Fibonacci numbers in its top row. This approach enables efficient computation of large Fibonacci numbers using matrix exponentiation, bypassing the need to calculate all intermediate terms.

First 8 Fibonacci numbers
8 terms
Generates 0, 1, 1, 2, 3, 5, 8, 13 with a sum of 33.
Golden ratio demonstration
15 terms
Shows how consecutive ratios (like 377/233 = 1.618) approach the golden ratio φ.
Nature pattern analysis
12 terms
Reveals the numbers often counted in flower petals, pine cones and sunflower heads.

Common questions

How do you calculate the Fibonacci sequence step by step?
Start with 0 and 1. Add them to get 1. Then add 1 + 1 = 2, then 1 + 2 = 3, then 2 + 3 = 5, and so on. Each new number is the sum of the two numbers before it. This Fibonacci sequence generator automates this process for up to 100 terms.
What is the golden ratio in Fibonacci numbers?
As Fibonacci numbers get larger, the ratio between consecutive terms approaches 1.618, known as the golden ratio or φ (phi). For example, 233/144 = 1.6181. The golden ratio is often linked with nature and art, though many claimed examples do not hold up when measured.
Where do you find Fibonacci numbers in nature?
Fibonacci numbers appear in flower petals (lilies have 3, buttercups have 5, daisies often have 34 or 55), pinecone spirals and sunflower seed patterns. The nautilus shell is a logarithmic spiral, not a Fibonacci one. Use this Fibonacci sequence generator to explore these natural patterns and verify the numbers you observe.

Need something this doesn't cover?

Suggest a tool — we'll build it →