Fibonacci Sequence Generator

Generate the Fibonacci sequence with as many terms as you need (up to 5,000, every digit exact), find the nth Fibonacci number instantly, even when it has tens of thousands of digits, and check whether any number belongs to the sequence. You can also create Lucas numbers or your own custom starting values, and watch the ratio of consecutive terms converge on the golden ratio.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile

Generate a sequence

Find the nth Fibonacci number

Is it a Fibonacci number?

Ratios converging to the golden ratio
nF(n+1) / F(n)Value

Private by design: every calculation runs locally in your browser. Nothing you type is sent to a server or stored by us.

What Is the Fibonacci Sequence?

The Fibonacci sequence is a series of numbers where each term is the sum of the two before it. It starts 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, and continues forever. Written as a formula: F(n) = F(n−1) + F(n−2), with F(0) = 0 and F(1) = 1. The sequence is named after Leonardo of Pisa, known as Fibonacci, who introduced it to Europe in his book Liber Abaci in 1202 through a puzzle about breeding rabbits. Indian mathematicians had described it centuries earlier in the study of Sanskrit poetry rhythms.

The Fibonacci numbers turn up in a surprising number of places: the spiral arrangement of sunflower seeds and pine cones, the branching of trees, the number of petals on many flowers, computer science algorithms, financial chart analysis (Fibonacci retracements) and agile software estimation (planning poker uses 1, 2, 3, 5, 8, 13). This generator helps students, programmers, teachers and puzzle lovers produce the sequence, look up any term, and explore its connection to the golden ratio.

How to Use the Fibonacci Generator

  1. Choose how many terms you want, from 1 up to 5,000. Every term is calculated exactly, with no rounding, even at hundreds of digits.
  2. Choose the starting point: 0, 1 (the modern convention), 1, 1 (the classic convention), Lucas numbers, or your own two starting values.
  3. Pick a separator and optionally show the index of each term, then copy or download the list.
  4. Find the nth term: type n to get F(n) directly, up to F(200,000).
  5. Check a number to see whether it's in the sequence and at which position.

The First 20 Fibonacci Numbers

nF(n)nF(n)
001055
111189
2112144
3213233
4314377
5515610
6816987
713171,597
821182,584
934194,181

Fibonacci and the Golden Ratio

Divide any Fibonacci number by the one before it and you get closer and closer to the golden ratio, φ (phi) = (1 + √5) / 2 ≈ 1.6180339887. For example: 8/5 = 1.6, 13/8 = 1.625, 21/13 ≈ 1.615, 34/21 ≈ 1.619, and by 144/89 the value is accurate to four decimal places. The golden ratio appears in art, architecture and design because rectangles in this proportion are often considered especially pleasing. It also leads to Binet's formula, which calculates any Fibonacci number directly: F(n) = (φn − (1−φ)n) / √5. For large n, this is simply φn/√5 rounded to the nearest whole number.

How the Nth Term Is Calculated So Fast

Adding terms one by one would take 100,000 steps to reach F(100,000). This tool instead uses the fast doubling method, based on two identities: F(2k) = F(k) × (2F(k+1) − F(k)) and F(2k+1) = F(k)² + F(k+1)². By halving n at each step, it needs only about log₂(n) steps, around 17 for n = 100,000. Combined with JavaScript's BigInt arbitrary-precision integers, it produces numbers with tens of thousands of digits in milliseconds, entirely in your browser.

Interesting Fibonacci Properties

  • Every third Fibonacci number is even, and every fourth is divisible by 3.
  • Sum rule: the sum of the first n terms equals F(n+2) − 1.
  • GCD property: gcd(F(m), F(n)) = F(gcd(m, n)).
  • Perfect-square test: x is a Fibonacci number if and only if 5x² + 4 or 5x² − 4 is a perfect square. The checker uses this test.
  • Lucas numbers (2, 1, 3, 4, 7, 11, 18…) follow the same rule with different seeds. Any two starting values give a "generalised Fibonacci" sequence whose ratio still tends to φ.

Features

  • Up to 5,000 termsEvery digit exact, with BigInt.
  • Nth term finderF(n) up to n = 200,000 in milliseconds.
  • Fibonacci checkerIs your number in the sequence?
  • Custom sequencesLucas numbers or any two seeds.
  • Golden ratioWatch the ratios converge to φ.
  • Copy and downloadComma, space or line separated.

Frequently Asked Questions

Does the Fibonacci sequence start with 0 or 1?

Both are used. The modern mathematical convention is F(0) = 0, F(1) = 1. Fibonacci's original version started 1, 1. The generator lets you choose.

What is the 100th Fibonacci number?

F(100) = 354,224,848,179,261,915,075, a 21-digit number.

Is 0 a Fibonacci number?

Yes, with the standard convention F(0) = 0.

What is the formula for the Fibonacci sequence?

F(n) = F(n−1) + F(n−2). The closed form (Binet's formula) is F(n) = (φn − ψn)/√5, where ψ = 1 − φ.

Where does Fibonacci appear in nature?

In the spirals of sunflowers, pine cones and pineapples (often 8, 13, 21, 34 or 55 spirals), in leaf arrangements (phyllotaxis) and in branching patterns.