Fibonacci calculator — exact nth term or the first n numbers

Enter n to get the exact nth Fibonacci number, with every digit, or switch to "First n terms" to list the sequence from F(0) = 0.

Live demo · real result from this tool
Show
Convention: F(0) = 0, F(1) = 1.
F(50)12,586,269,025
Digits
11
F(50)/F(49) (→ φ)
1.61803398875

Exact value

12586269025

Processed on your device — nothing is uploaded.

How to use the Fibonacci calculator

  1. Under Show, choose nth term for one number or First n terms for a list.
  2. Type a whole number in n.
  3. For one term, read F(n), the number of Digits and the ratio to the previous term. Large values appear in scientific form at the top, with every digit in the Exact value box.
  4. For a list, copy the comma-separated line or download the table.

What it does and when to use it

The Fibonacci sequence starts 0, 1 and then each number is the sum of the two before it: 0, 1, 1, 2, 3, 5, 8, 13 and so on. It shows up in maths classes on sequences and recursion, in programming exercises, and in puzzles about rabbits, stairs and tilings.

Use this calculator to check a homework answer, to get a term too big for a phone calculator, or to make a test list for code you are writing. If you are studying sequences in general, the sequence calculator covers arithmetic and geometric sequences, and the golden ratio calculator explains φ.

How it works

The rule is F(n) = F(n − 1) + F(n − 2), with F(0) = 0 and F(1) = 1. The list mode applies this rule term by term.

For a single large term, adding one step at a time would be slow, so the tool uses fast doubling. Two identities let it jump from position k to position 2k:

  • F(2k) = F(k) × (2F(k + 1) − F(k))
  • F(2k + 1) = F(k)² + F(k + 1)²

Halving n again and again means even F(200,000) needs only about 18 doubling steps.

Step by step for F(10) with fast doubling:

  1. 10 = 2 × 5, so we need F(5) and F(6).
  2. From the start of the sequence, F(5) = 5 and F(6) = 8.
  3. F(10) = F(5) × (2 × F(6) − F(5)) = 5 × (16 − 5) = 5 × 11 = 55.

The tool reports F(10): 55 and the ratio F(10)/F(9) (→ φ): 1.61764705882.

Worked examples

A small term. n = 10 in nth-term mode gives F(10): 55.

F(100). The exact answer is 354,224,848,179,261,915,075, which has 21 digits.

A list. First n terms with n = 12 returns 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89. The last term is F(11), because counting starts at F(0).

A very large term. n = 1000 shows F(1000): 4.346655768 × 10²⁰⁸ and Digits: 209, with all 209 digits in the exact box.

Limits and tips

  • n must be a whole number, 0 or more. Negative positions are not supported.
  • The list stops at 1,000 terms; ask for single terms beyond that.
  • To check whether a Fibonacci number is prime or to split it into factors, paste it into the prime factorization tool.
  • Everything is computed on your device.

Frequently asked questions

Does the sequence start at 0 or 1?
This tool uses F(0) = 0 and F(1) = 1, the usual convention in maths and programming. Some books start with F(1) = F(2) = 1; the numbers are the same, only the position label shifts by one.
How large can n be?
For a single term, n can go up to 200,000; F(200,000) has 41,798 digits. The list mode shows between 1 and 1,000 terms.
Are the big numbers exact?
Yes. The tool uses whole-number arithmetic with no size limit (JavaScript BigInt), so every digit is correct. Ordinary floating-point numbers are exact only up to F(78); after that the last digits get rounded.
What is the ratio line for?
It shows F(n) ÷ F(n − 1). As n grows, this ratio gets closer to the golden ratio φ ≈ 1.61803398875. The line appears for n from 2 up to 1,399.
Can I save the list?
In "First n terms" mode the table of n and F(n) can be downloaded as fibonacci.csv for a spreadsheet.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close