Fibonacci Sequence Generator

Generate the first N terms of the Fibonacci sequence

Generate the first N terms of the Fibonacci sequence using BigInt for exact, arbitrary-precision values that never lose accuracy on large terms. Choose how many terms to produce and copy the full list. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does the Fibonacci sequence start?

This generator uses the common convention F(0) = 0 and F(1) = 1. Every subsequent term is the sum of the two before it: 0, 1, 1, 2, 3, 5, 8, 13, and so on.

The Fibonacci sequence is the classic series where each number is the sum of the two before it. This generator produces the first N terms exactly, using arbitrary-precision integers so even very large terms are correct to the last digit.

How it works

Starting from the two seed values 0 and 1, each new term adds the previous two:

F(0) = 0
F(1) = 1
F(n) = F(n-1) + F(n-2)

That gives 0, 1, 1, 2, 3, 5, 8, 13, 21, …. The tool iterates this rule with BigInt, which has no upper size limit, so terms far beyond the float64 safe range remain exact rather than rounding off.

Why BigInt matters for this sequence

JavaScript’s standard number type is a 64-bit float, which can represent integers exactly only up to 2⁵³ − 1 (about 9 quadrillion). The Fibonacci sequence reaches that limit around its 78th term. Without arbitrary-precision arithmetic, every term from F(78) onward would be silently rounded to the nearest representable float — producing wrong answers that look right.

By using BigInt, this generator produces exact values for any number of terms you request. The 100th Fibonacci number has 21 digits. The 200th has 42 digits. The 1000th has 209 digits. All are exact.

First 15 terms for reference

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377

Asking for 10 terms returns the first 10 of these. Asking for 20 extends it to 6,765 at F(19).

The golden ratio connection

Divide any Fibonacci number by the one before it and the result converges toward φ ≈ 1.61803398875 (the golden ratio). The convergence is rapid — by around the 20th term the ratio already matches φ to four decimal places. This is not coincidence: it follows directly from the recurrence relation, and the golden ratio is the positive root of x² = x + 1.

The golden ratio appears in geometry (pentagons, logarithmic spirals), in nature (phyllotaxis patterns in sunflowers and pine cones), and in design. The Fibonacci sequence is the simplest integer sequence that generates it.

Common uses for the sequence

  • Mathematics education: illustrating recurrence relations, exponential growth, and number theory.
  • Algorithm testing: Fibonacci is a classic benchmark for recursion, memoisation, and big-number arithmetic. Use this tool to get a reference list of exact values to test against.
  • Design grids: designers sometimes use Fibonacci proportions (5, 8, 13, 21 pixels or units) to size elements — the tool gives you the exact numbers to work with.
  • Puzzles and competitions: some programming contest problems involve Fibonacci numbers in the hundreds; exact BigInt output gives you ground-truth values to verify solutions against.