Fibonacci Calculator

Get any Fibonacci number from F(-100000) to F(100000) with every digit correct, list up to 500 terms with the gap to the golden ratio beside each one, or paste a number to learn whether the sequence contains it. Results use whole-number arithmetic, so F(100) reads 354224848179261915075 instead of a rounded 3.54e20.

Fibonacci calculator workspace

Each term is the sum of the two before it. The table updates as you type.

Enter a value on the left, or press Load sample to see 20 terms with their golden ratio gaps.

Fibonacci numbers with every digit intact

The rule fits on one line. Start with 0 and 1, then add the last two terms to get the next. The first 25 terms below cover what most homework asks for. Past F(70) the arithmetic gets harder for software than for people, and the section after the list explains why.

  1. 00
  2. 11
  3. 21
  4. 32
  5. 43
  6. 55
  7. 68
  8. 713
  9. 821
  10. 934
  11. 1055
  12. 1189
  13. 12144
  14. 13233
  15. 14377
  16. 15610
  17. 16987
  18. 171,597
  19. 182,584
  20. 194,181
  21. 206,765
  22. 2110,946
  23. 2217,711
  24. 2328,657
  25. 2446,368

Small grey numbers are the index n. F(12) = 144 is the only Fibonacci number above 1 equal to a perfect square.

Why many Fibonacci calculators go wrong after F(70)

Most web calculators, spreadsheets, and quick scripts store numbers as 64-bit floating point values. Those hold about 15 to 16 significant digits. Fibonacci numbers gain a digit roughly every 4.8 terms, so the trouble starts early. We ran each common method against exact whole-number results to find the first wrong answer.

MethodLast exact termFirst failure
Binet formula, round(φn / √5) in floating pointF(70)F(71) comes out as 308061521170130, one too high
Loop with a, b = b, a + b on JavaScript numbersF(78) = 8944394323791464F(79) passes 253 and the last digits drift
Excel or Google Sheets, =A1+A2 filled downF(73), 15 digitsF(74) has 16 digits and the display pads with zeros
Floating point, any methodnone past F(1476)F(1477) overflows to Infinity
BigInt fast doubling, used on this pageF(100000), 20,899 digitsNone inside the input range

The old version of this page used the floating point loop, so F(79) and every term after it carried wrong digits. The rewrite moved everything to JavaScript BigInt. Paste F(100) from here into any checker and every one of its 21 digits matches.

How F(100000) comes back in a few milliseconds

Adding terms one at a time takes n steps. Fast doubling takes about log2(n) steps, around 17 for n = 100,000. Two identities do the work:

Read n in binary from the top bit down. Each bit doubles k, and a 1 bit adds one more step. Python integers have no size limit, so the same idea runs there without a library:

def fib(n):
    if n == 0:
        return (0, 1)
    a, b = fib(n // 2)
    c = a * (2 * b - a)
    d = a * a + b * b
    return (d, c + d) if n % 2 else (c, d)

print(fib(100)[0])   # 354224848179261915075

On a recent laptop, the calculator above returns F(100000) in under 10 ms. Most of the wait you notice is the browser drawing 20,899 digits, which is why long results open folded.

Watching the ratio settle on the golden ratio

Divide any term by the one before and the result drifts toward φ = 1.6180339887... from alternate sides. 2/1 overshoots, 3/2 falls short, 5/3 overshoots again. The gap shrinks by a factor of about 2.6 per step, so each extra term buys roughly 0.4 correct decimal places.

RatioValueDistance from φ
F(6) / F(5)1.6000000000001.8 × 10−2
F(11) / F(10)1.6181818181821.5 × 10−4
F(16) / F(15)1.6180327868851.2 × 10−6
F(21) / F(20)1.6180339985229.8 × 10−9
F(31) / F(30)1.6180339887516.5 × 10−13

Pick Lucas or a custom pair in the sequence tab and the ratio chart heads to the same line. Any two positive starting numbers converge on φ. The starting pair only changes how fast the early ratios settle.

The 5n2 ± 4 test for spotting Fibonacci numbers

A whole number n belongs to the sequence exactly when 5n2 + 4 or 5n2 − 4 is a perfect square. Try 21. Five times 441 is 2,205. Add 4 and you get 2,209, which is 472. So 21 is in. For 1,000 the two candidates are 5,000,004 and 4,999,996, and neither has a whole square root, so 1,000 is out.

The checker tab runs this test with exact square roots for numbers up to 30 digits and shows both values. Past 30 digits the squares get unwieldy to read, so the checker walks the sequence instead and reports the neighbours on either side. Both routes give the same answer.

Zeckendorf sums, and a miles to kilometres trick

Every positive whole number splits into Fibonacci numbers with no two neighbours in the sequence, and that split is unique. Take the largest Fibonacci number that fits, subtract, and repeat.

A mile is 1.609 km, close to φ. Shift each piece of a Zeckendorf sum one place up the sequence and you convert miles to kilometres in your head. 100 miles is 89 + 8 + 3, which shifts to 144 + 13 + 5 = 162 km. The true figure is 160.9. Shift down to go the other way. The checker prints the sum for any number you test, Fibonacci or not.

Index 0 or index 1, and negative positions

Off-by-one mismatches cause most disagreements between Fibonacci lists. This page follows the convention used by OEIS A000045 and most programming references: F(0) = 0, F(1) = 1, F(2) = 1. Some textbooks begin at F(1) = F(2) = 1 and never mention zero. The values agree, only the labels shift. Switch the First term menu to index 1 when your source starts there.

Run the rule backwards and the sequence extends to negative positions: F(−1) = 1, F(−2) = −1, F(−3) = 2, F(−4) = −3. The sizes repeat the positive side and the signs alternate. Type a negative n in the F(n) tab to see the sign rule applied.

Patterns to test with the calculator

Sunflowers, shells, and trading charts

Sunflower heads, pine cones, and pineapples often show spiral counts of neighbouring Fibonacci numbers, such as 34 and 55, or 55 and 89. Botanists tie this to new seeds forming at a turn close to 137.5 degrees. The nautilus shell is a different case. Measured shells grow along a spiral, but not the golden one, so treat that popular claim with suspicion.

Traders draw Fibonacci retracement lines at 23.6, 38.2, and 61.8 percent. Those levels come from ratios of terms three, two, and one positions apart. This calculator gives you the sequence and the ratios. Price levels for a chart belong in charting software.

Where this calculator stops

All math runs in your browser tab. Nothing you type reaches a server. Copy link stores the mode and your inputs in the address bar, nothing else.

Fibonacci calculator questions

Indexing, precision, Lucas numbers, spreadsheets, and how the checker works.

What is the 100th Fibonacci number?

F(100) is 354224848179261915075, a 21-digit number, counting F(0) = 0 as the start. If your list starts at F(1) = 1, the hundredth entry is F(99) = 218922995834555169026 instead. Many calculators show 3.542248481792619e20 for F(100), which replaces the last five digits with zeros.

Why does another site give a different answer for F(n)?

Two causes cover almost every case. The first is indexing. If the other source starts at 1, 1 instead of 0, 1, its term n matches F(n) here but its position count is off by one. Compare F(10): both should read 55. The second is precision. Anything past F(78) computed with ordinary floating point carries wrong trailing digits, and past F(1476) it overflows.

Is 0 a Fibonacci number? What about 1?

Yes to both. 0 is F(0). The number 1 appears twice, as F(1) and F(2), and the checker lists both positions. Every other Fibonacci number appears once.

What are Lucas numbers?

Lucas numbers follow the same add-the-last-two rule but start at 2 and 1: 2, 1, 3, 4, 7, 11, 18, 29, 47. Each one equals the sum of the Fibonacci numbers on either side of the same position, so L(10) = F(9) + F(11) = 34 + 89 = 123. Pick Lucas in the starting pair menu to list them. The F(n) tab also prints L(n) for the position you enter.

How do I make the Fibonacci sequence in Excel?

Type 0 in A1, 1 in A2, then =A1+A2 in A3 and fill down. A1 holds F(0), so row r holds F(r - 1). Results stay exact through row 74, F(73). From F(74) on, the numbers pass 15 significant digits and Excel shows zeros in place of the final digits. For larger terms, copy the CSV export from this page and import the column as text.

How does the checker decide a number is not Fibonacci?

Up to 30 digits it runs the 5n squared plus or minus 4 test with exact integer square roots. Above 30 digits it builds the sequence until a term reaches or passes your number. In both cases you see the Fibonacci numbers directly below and above, the distance to each, and the Zeckendorf sum. A miss by one or two usually means a typo or a value copied from a rounded source.

How do I share a result or save the full digits?

Copy link puts the mode and your inputs into the address, for example toolexe.com/math/fibonacci?mode=nth&position=500. Opening it recomputes the result in the other browser. Download saves the current result as a text file, or as CSV or JSON in sequence mode. Every format stores terms as strings, since large terms overflow numeric types in most languages.