Fibonacci Calculator
Free Fibonacci calculator: find the nth Fibonacci number, generate sequences, or check if a number is Fibonacci. Supports Lucas numbers, negative indices, BigInt precision up to F(10,000), and golden ratio convergence.
Range: -1,000 to 10,000
Properties
Number characteristics and golden ratio convergence
Fibonacci(10) / Fibonacci(9)
1.6176470588
φ (phi)
1.6180339887
Difference: 3.869299e-4
Step-by-Step Calculation
Iterative computation using the recurrence relation
Recurrence relation
Fibonacci(n) = Fibonacci(n-1) + Fibonacci(n-2)
Fibonacci(0) = 0
Fibonacci(1) = 1
Fibonacci(2) = Fibonacci(1) + Fibonacci(0) = 1 + 0 = 1
Fibonacci(3) = Fibonacci(2) + Fibonacci(1) = 1 + 1 = 2
Fibonacci(4) = Fibonacci(3) + Fibonacci(2) = 2 + 1 = 3
Fibonacci(5) = Fibonacci(4) + Fibonacci(3) = 3 + 2 = 5
Fibonacci(6) = Fibonacci(5) + Fibonacci(4) = 5 + 3 = 8
Fibonacci(7) = Fibonacci(6) + Fibonacci(5) = 8 + 5 = 13
Binet's Formula (closed-form)
F(n) = (phin - psin) / sqrt(5)
where phi = (1+sqrt(5))/2 = 1.618... and psi = (1-sqrt(5))/2 = -0.618...
What Is the Fibonacci Sequence?
The most famous number sequence in mathematics, from ancient India to modern science
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones. Starting from 0 and 1, the sequence goes: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... and continues infinitely. Named after the Italian mathematician Leonardo of Pisa (known as Fibonacci), who introduced it to Western Europe in his 1202 book Liber Abaci, the sequence was originally described by Indian mathematicians as early as 200 BC in the context of Sanskrit prosody.
Recurrence Relation
F(n) = F(n-1) + F(n-2)
with seed values F(0) = 0 and F(1) = 1
F(10)
55
2 digits
F(50)
12,586,269,025
11 digits
F(100)
21 digits
~3.54 x 10^20
F(1000)
209 digits
~4.35 x 10^208
The sequence grows exponentially — each Fibonacci number has approximately 0.209 more digits than its predecessor. Despite this explosive growth, the ratio of consecutive Fibonacci numbers converges to the golden ratio phi = 1.618034..., a mathematical constant that appears throughout nature, art, and architecture.
The Golden Ratio & Binet's Formula
How Fibonacci numbers connect to phi = 1.618... and a remarkable closed-form solution
As n increases, the ratio F(n)/F(n-1) converges rapidly to the golden ratio phi = (1 + sqrt(5)) / 2 = 1.6180339887... This is because phi satisfies the equation phi2 = phi + 1, which is the characteristic equation of the Fibonacci recurrence. This deep algebraic connection leads to one of mathematics' most elegant closed-form formulas.
Binet's Formula
F(n) = (phin - psin) / sqrt(5), where psi = (1 - sqrt(5)) / 2 = -0.618... Since |psi| < 1, the term psin vanishes for large n, giving the approximation F(n) = phin / sqrt(5).
Convergence Rate
The error |F(n)/F(n-1) - phi| decreases by a factor of phi2 = 2.618 with each step. By n = 13, the ratio matches phi to 5 decimal places. By n = 30, it's accurate to 12 digits.
Convergence of F(n)/F(n-1) to phi
| n | F(n) | F(n)/F(n-1) | Error |
|---|---|---|---|
| 2 | 1 | 1.000000 | 0.618 |
| 5 | 5 | 1.666667 | 0.0486 |
| 10 | 55 | 1.617647 | 3.87e-4 |
| 15 | 610 | 1.618033 | 1.13e-6 |
| 20 | 6765 | 1.618034 | 3.30e-9 |
phi = 1.6180339887498948... (exact: (1 + sqrt(5)) / 2)
Fibonacci in Nature, Finance & Computer Science
From sunflower spirals to stock trading and algorithm analysis
Fibonacci numbers are not just a mathematical curiosity — they appear as an organizing principle across biology, financial markets, and computing. The underlying reason is that growth processes governed by “the next state depends on the previous two states” naturally produce Fibonacci-like patterns.
Nature & Biology
Flower petals follow Fibonacci counts (lilies 3, buttercups 5, daisies 34 or 55). Sunflower seed heads display 34 and 55 counter-rotating spirals. Pinecone bracts, pineapple scales, and nautilus chambers all reflect this pattern. The reason: Fibonacci-based phyllotaxis maximizes access to sunlight and rain.
Art & Architecture
The golden rectangle (aspect ratio phi:1) has been used in the Parthenon, the Mona Lisa, and modern logo design. The Fibonacci spiral — built from quarter-circles in golden rectangles — appears in Le Corbusier's Modulor system and contemporary UI grids.
Finance & Trading
Fibonacci retracement levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) are derived from ratios of consecutive Fibonacci numbers. Traders use them to identify potential support/resistance zones in stocks, forex, and crypto. The 61.8% level (1/phi) is considered the strongest signal.
Computer Science
Fibonacci heaps achieve O(1) amortized insert. Zeckendorf's theorem gives every positive integer a unique Fibonacci representation. The worst case of Euclid's GCD algorithm is consecutive Fibonacci numbers. Fibonacci hashing provides excellent distribution for hash tables.
23.6% = 1 - F(n)/F(n+3), 38.2% = 1/phi2, 50% (midpoint), 61.8% = 1/phi, 78.6% = sqrt(1/phi)
Related Sequences, Properties & How to Compute
Lucas numbers, negative indices, divisibility rules, and efficient algorithms
Lucas Numbers
The Lucas sequence uses the same recurrence L(n) = L(n-1) + L(n-2) but starts with L(0) = 2, L(1) = 1: 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, ... Lucas numbers satisfy L(n) = F(n-1) + F(n+1). Both sequences share the golden ratio as their growth rate.
Negative Indices & Identities
The sequence extends to negative indices via F(n-2) = F(n) - F(n-1), giving: ..., 5, -3, 2, -1, 1, 0, 1, 1, 2, 3, 5, ... The rule is F(-n) = (-1)n+1 * F(n). Other key identities include Cassini's identity: F(n-1) * F(n+1) - F(n)2 = (-1)n, and the summation formula: F(0) + F(1) + ... + F(n) = F(n+2) - 1.
Divisibility Properties
Every 3rd Fibonacci number is even. Every 4th is divisible by 3. Every 5th by 5. Every 6th by 8. In general, F(m) divides F(n) whenever m divides n. The GCD property: gcd(F(m), F(n)) = F(gcd(m, n)). The Pisano period gives the cycle length of F(n) mod m — for example, Fibonacci numbers mod 10 repeat every 60 terms (the last digit cycles with period 60).
Computing Fibonacci Numbers
Iterative (this tool)
O(n) time, O(1) space. Simple loop with two variables. Exact with BigInt for any n. Best for practical computation.
Matrix exponentiation
O(log n) time via [[1,1],[1,0]]^n. Uses fast matrix power. Optimal for very large n without needing all intermediate terms.
Python
def fib(n):
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a
# fib(100) -> exact 21-digit resultExcel / Google Sheets
A1: 0 B1: 1 A2: =B1 B2: =A1+B1 Drag row 2 down to generate the full sequence. Max precision: 15 digits (use BigInt tools for more)
Frequently Asked Questions
Common questions about Fibonacci numbers, the golden ratio, and sequence calculations
Embed Fibonacci Calculator
Add this calculator to your website or blog for free.
You Might Also Like
Related calculators from other categories
Last updated Apr 12, 2026