Connect via MCP →

Enter Calculation

n = 1, 2, 3, ... (positive integers)

Formula

Advertisement

Results

Fibonacci number F12
144
exact integer value
Ordinal n 12
Seed convention F1 = 1, F2 = 1
Method Iterative integer recurrence (exact)

What is the Fibonacci Number Calculator?

This tool returns the n-th Fibonacci number, written \(F_n\), for any positive integer ordinal index \(n\). The Fibonacci sequence is one of the most famous integer sequences in mathematics: every term is the sum of the two terms before it. Using the seeds \(F_1 = 1\) and \(F_2 = 1\), the sequence begins 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, and continues forever. Fibonacci numbers appear in nature, art, computer science, and the golden ratio.

How to use it

Enter the ordinal index \(n\) (1, 2, 3, ...) in the input box and submit. The calculator returns the exact value of \(F_n\). Because Fibonacci numbers grow roughly like \(\phi^n / \sqrt{5}\), they get very large very quickly, so this tool uses exact big-integer arithmetic instead of floating point. That keeps even large results perfectly accurate, with no rounding error.

The formula explained

The defining recurrence is $$F_n = F_{n-1} + F_{n-2}, \qquad F_1 = F_2 = 1$$ There is also a closed form, Binet's formula: $$F_n = \frac{\phi^n - \psi^n}{\sqrt{5}},$$ where \(\phi = \frac{1 + \sqrt{5}}{2}\) is the golden ratio and \(\psi = \frac{1 - \sqrt{5}}{2}\). Both give the same values for this 1-based convention, but Binet's formula loses precision for large \(n\) due to floating-point rounding, so we compute the answer iteratively for exactness.

Diagram showing two consecutive Fibonacci terms adding to produce the next term
Each Fibonacci number is the sum of the two preceding terms.

Worked example

For \(n = 12\) we build up the sequence: \(F_1=1\), \(F_2=1\), \(F_3=2\), \(F_4=3\), \(F_5=5\), \(F_6=8\), \(F_7=13\), \(F_8=21\), \(F_9=34\), \(F_{10}=55\), \(F_{11}=89\), \(F_{12}=144\). So \(F_{12} = 144\). A Binet check: \(\phi^{12}\) is about 321.9969 and \(\psi^{12}\) about 0.0031, and $$\frac{321.9969 - 0.0031}{\sqrt{5}} \approx 144.0,$$ confirming the result.

Fibonacci squares tiling a rectangle with a golden spiral arc through them
Squares with Fibonacci side lengths tile a rectangle and trace the golden spiral.

FAQ

Why is \(F_1 = 1\) and \(F_2 = 1\) instead of \(F_0 = 0\)? This calculator uses the common 1-based convention where the sequence starts at index 1. In the alternative 0-based convention \(F_0 = 0\) and \(F_1 = 1\); the values are simply shifted by one index.

Can it handle large \(n\)? Yes. It uses exact big-integer math, so even large indices return the full exact integer rather than an approximation.

What is the smallest valid \(n\)? \(n\) must be a positive integer, so the minimum is \(n = 1\), which gives \(F_1 = 1\).

Last updated: