Skip to main content
Math

Fibonacci Sequence Calculator

The Fibonacci sequence starts 0, 1 and every term after is the sum of the two before: 0, 1, 1, 2, 3, 5, 8, 13, 21…. Enter any index n between 0 and 1500 and this tool returns F(n), F(n−1), the consecutive-term ratio F(n) ÷ F(n−1) — which converges to the golden ratio φ ≈ 1.618 — and the first 30 terms, all using BigInt for exact integer arithmetic.

F(n) — the n-th term

6,765

F(n−1) — the previous term

4,181

Consecutive ratio F(n) ÷ F(n−1)

1.61803399

Golden ratio φ ≈ 1.61803399

First 21 terms

Starting at F(0); up to the first 30 terms shown.

    F(0)=0 and F(1)=1; every subsequent term is the sum of the previous two. The ratio of consecutive terms converges to the golden ratio φ ≈ 1.6180. Calculations use BigInt, so they remain exact past JavaScript's 53-bit floating-point limit.

    Formula

    F(0) = 0, F(1) = 1, F(n) = F(n−1) + F(n−2) Consecutive ratio: F(n) ÷ F(n−1) → φ = (1 + √5) ÷ 2 ≈ 1.6180339887…

    Frequently asked

    What is F(100), and can JavaScript compute it accurately?

    F(100) = 354,224,848,179,261,915,075 — 21 digits. Plain JavaScript Numbers carry only 53 bits of precision (Number.MAX_SAFE_INTEGER ≈ 9 × 10¹⁵, about 16 digits) and start losing precision from F(78) onward. This tool uses BigInt addition throughout, so every step is exact — even F(1500) returns instantly with no rounding.

    Why does the ratio of consecutive Fibonacci numbers converge to the golden ratio?

    Let r = lim F(n+1) ÷ F(n). Dividing both sides of the recurrence by F(n) gives F(n+1)/F(n) = 1 + F(n−1)/F(n), so r = 1 + 1/r, which rearranges to r² − r − 1 = 0. The positive root is r = (1 + √5) / 2 = φ ≈ 1.61803. The closed form (Binet's formula) F(n) = (φⁿ − ψⁿ) / √5 with ψ = 1 − φ ≈ −0.618 makes the same limit explicit.

    Can I compute F(n) directly with Binet's closed-form formula instead of iterating?

    In theory yes: F(n) = (φⁿ − ψⁿ) / √5. In practice √5 and φ are irrational, so floating-point evaluation introduces rounding error and loses accuracy from about n ≈ 70 onward. For exact integer results across all n you still need BigInt — either via the O(n) recurrence (what this tool uses) or matrix exponentiation. The plain recurrence handles n = 1500 in milliseconds.

    Is 0 a Fibonacci number? Or does the sequence start at F(1) = 1?

    It depends on the convention. Modern references — including OEIS A000045 — use F(0) = 0 and F(1) = 1, so 0 is a Fibonacci number. Some older textbooks index from F(1) = 1, F(2) = 1, skipping zero; aside from the starting index the two conventions agree. This tool follows the OEIS convention.

    Related tools

    Percentage Calculator

    Percent of, percent change, and percent add/subtract in one.

    GCD & LCM Calculator

    Enter 2–6 positive integers to get the greatest common divisor (HCF / GCD) and least common multiple (LCM), with the Euclidean step chain shown.

    Average Calculator (Mean / Median / Mode)

    Enter a list of numbers to get the mean, median, mode, range plus standard deviation, variance and total.

    Quadratic Equation Solver

    Enter the coefficients of ax² + bx + c = 0 to find the real or complex roots, discriminant and vertex.

    Password Strength (Entropy) Calculator

    Estimate a password's bit entropy, brute-force time and strength tier. All computation happens in your browser.

    Scientific Notation Converter

    Convert between standard decimal numbers and scientific notation, with significant figures and order of magnitude.

    Permutations & Combinations (nPr / nCr) Calculator

    Compute permutations P(n,r), combinations C(n,r) and factorial n! — useful for probability problems, lottery odds and combinatorics homework.

    Standard Deviation Calculator

    Paste a list of numbers to compute mean, median, sample and population variance and standard deviation — with the working shown.

    Triangle Calculator (SSS / SAS / ASA)

    Solve a triangle from 3 sides, 2 sides + 1 angle, or 2 angles + 1 side — area, perimeter and remaining parts via the law of sines / cosines.

    Pythagorean Theorem Calculator

    Given any two sides of a right triangle (two legs, or one leg plus the hypotenuse), instantly find the third side, area, perimeter and the two non-right angles.

    Circle Calculator (radius / diameter / circumference / area)

    Enter any one of radius, diameter, circumference or area to get the other three — useful for design, engineering and DIY.

    Roman Numeral Converter

    Two-way conversion between Arabic numbers (1–3999) and Roman numerals (I, V, X, L, C, D, M) — handy for typesetting, chapter titles and homework.

    Slope & Line Equation Calculator (y = mx + b from Two Points)

    Enter two points (x₁, y₁) and (x₂, y₂) to instantly get the slope, y-intercept, line equation y = mx + b, distance, and midpoint — a classroom staple for algebra and coordinate geometry.

    Birthday Paradox Calculator

    Enter group size n to see the probability that at least two people share a birthday — the classic birthday problem.

    Logarithm Calculator (log / ln / log₂ / any base)

    Compute logₐ(x) for any base — natural log (ln), common log (log₁₀), binary log (log₂) and a custom base, with the change-of-base steps shown.

    Z-Score (Standard Score) Calculator

    Enter a value, the mean and the standard deviation to compute the z-score and the corresponding normal-distribution percentile and probabilities.

    Screen Pixel Density (PPI) Calculator

    Enter the screen resolution and diagonal size to get pixel density (PPI), real width/height, dot pitch and total pixel count.

    Hong Kong Mark Six Odds Calculator

    Enter the number of tickets / selections and see the actual probability of hitting first, second … prizes in a Mark Six (6-of-49) draw.

    Decimal to Fraction Converter

    Convert any decimal (including repeating decimals) to a simplified fraction and a mixed number.

    Sphere Volume & Surface Area Calculator

    Give a sphere any one of radius, diameter, surface area or volume and instantly get the other three — plus the great-circle circumference and area.

    Cylinder Volume & Surface Area Calculator

    Enter the radius and height of a cylinder to get volume (π r²h), lateral surface, base area and total surface area.

    Prime Factorization Calculator

    Factor any integer from 2 up to 10¹² into primes, see the canonical exponent form, count and list all divisors.

    Geometric Mean Calculator

    Compute the n-th root of the product of n positive numbers — the right average for growth rates, returns and ratios — alongside the arithmetic mean for comparison.