Home › Math › Fibonacci Number Calculator
Fibonacci Number Calculator
Computes the n-th Fibonacci number exactly with arbitrary-precision integers, together with F(n−1), F(n+1), the ratio F(n)/F(n−1) compared with the golden ratio, and optionally tests whether a given integer is a Fibonacci number.
When to use
You need a specific Fibonacci number (exact, even with hundreds of digits), the terms around it, or want to check whether a number belongs to the sequence.
Do not use when: You need a general geometric or arithmetic progression (use geometric-sequence / arithmetic-sequence) or factorials and binomial coefficients (use factorial, combinations-permutations).
Formula
F(0) = 0, F(1) = 1, F(n) = F(n − 1) + F(n − 2); φ = (1 + √5)/2; N is a Fibonacci number ⇔ 5N² + 4 or 5N² − 4 is a perfect square (Gessel's test)
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
n | integer | yes | Position in the sequence with F(0) = 0, F(1) = 1, F(2) = 1, F(3) = 2, … Range: ≥ 0, ≤ 500 | |
check_number | string | no | Optional non-negative integer (as digits, any size) to test for membership in the Fibonacci sequence. |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
fibonacci | string | The n-th Fibonacci number as an exact decimal string. | |
fibonacci_number | number | The same value as a number; omitted from F(74) on (above 2^50), where a number would no longer carry every digit. | |
previous | string | The preceding Fibonacci number (omitted for n = 0). | |
next | string | The following Fibonacci number. | |
ratio | number | Ratio of consecutive terms, which converges to the golden ratio (omitted for n ≤ 1). | |
golden_ratio | number | (1 + √5) / 2 = 1.6180339887…, the limit of the ratio. | |
digits | integer | Decimal digits of F(n). | |
is_fibonacci | boolean | true when 5·N² + 4 or 5·N² − 4 is a perfect square (only when check_number is given). | |
check_index | integer | The smallest k with F(k) = check_number (only when it is a Fibonacci number). |
Example
F(50), is 144 Fibonacci?: {"n":50,"check_number":"144"} → {"fibonacci":"12586269025","fibonacci_number":12586269025,"previous":"7778742049","next":"20365011074","ratio":1.6180339887,"golden_ratio":1.6180339887,"digits":11,"is_fibonacci":true,"check_index":12}
F(10): {"n":10} → {"fibonacci":"55","fibonacci_number":55,"previous":"34","next":"89","ratio":1.6176470588,"digits":2}
GET https://tttkmbb.com/api/v1/calculate/fibonacci?n=50&check_number=144
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/fibonacci(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/fibonacci · Markdown: https://tttkmbb.com/math/fibonacci.md · JSON definition: https://tttkmbb.com/math/fibonacci.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="fibonacci" - OpenAPI operationId:
calculate_fibonacci_number - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Fibonacci sequence (reference)
- OEIS A000045 – Fibonacci numbers (reference)
- Wolfram MathWorld – Fibonacci Number (reference)
FAQ
Does the sequence start with 0 or 1?
This calculator uses the standard indexing F(0) = 0, F(1) = 1 (OEIS A000045), so F(10) = 55. Some texts start at F(1) = 1, F(2) = 1, which shifts the index by one.
How large can n be?
Up to 500: F(500) has 105 digits and is returned exactly as a string. The number output is omitted from F(74) on, because values above 2^50 cannot be returned as exact numbers.
Related calculators
- Geometric Sequence Calculator — Fibonacci numbers grow like a geometric sequence with ratio φ.
- Arithmetic Sequence Calculator — Sequences with a constant difference.
- Factorial Calculator — Another fast-growing integer sequence.