ForHosting KIT · Math

Fibonacci number calculator

The 10th Fibonacci number is 55, counting F1 and F2 as 1. Enter a position up to 10000 and get the exact term, even when it runs to hundreds of digits, or ask for every term up to it in one go. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
N
10
You get
Value
55

The Fibonacci sequence is the classic recurrence where each term is the sum of the two before it. This calculator uses the one-based convention F1 equals one and F2 equals one, so the sequence begins one, one, two, three, five, eight, thirteen, and so on—the indexing most students meet in contest problems and programming exercises. You supply a positive integer index n; the service returns the exact n-th term as a decimal string computed with BigInt arithmetic, so values far beyond ordinary floating-point or safe-integer limits stay correct digit for digit. When you need more than a single term, enable the optional list flag to receive the entire prefix F1 through Fn as an array of decimal strings. Negative indices and zero are rejected with a clear validation error rather than a silent wrong answer.

How the n-th Fibonacci number is defined and computed

We use the one-based Fibonacci indexing with F1 equal to one and F2 equal to one. Every later term satisfies Fk equals F(k−1) plus F(k−2) for k greater than or equal to three. Under that rule F3 is two, F4 is three, F5 is five, F6 is eight, F7 is thirteen, F8 is twenty-one, F9 is thirty-four, and F10 is fifty-five—the familiar classroom prefix.

The implementation never uses Binet’s formula or floating-point approximation; instead it walks the recurrence with BigInt addition from the first two terms up to n, which guarantees every digit is exact even when the result has hundreds of decimal places. The path is fully deterministic—no random seeds, no clocks, no network, and no model drift—so the same n always yields the same string and the same optional sequence.

Where Fibonacci calculations show up in real work

Data and analytics teams sometimes need deterministic integer sequences as synthetic keys, load-test ladders, or demo datasets; an exact string sequence avoids off-by-one mistakes between F0-based and F1-based codebases once the convention is fixed on the landing page. Product demos, coding interviews, and blog posts about dynamic programming often show a short Fibonacci table; listing F1 through Fn in one call keeps interactive demos honest without reimplementing the loop in every language.

If you later need modular Fibonacci, Lucas numbers, Zeckendorf representations, or matrix exponentiation for astronomical n, treat those as separate search intents rather than overloading this calculator landing.

Synthetic sequences in pipelines

Pull deterministic Fibonacci values into tests, demos, or load ladders without reimplementing BigInt addition in every service.

Why is value a string instead of a number?

Fibonacci numbers grow past JavaScript safe integers by F93. Decimal strings keep every digit exact for large n.

How do I get the full sequence F1 through Fn?

The response includes sequence as an array of decimal strings.

What happens if n is below 1?

Fibonacci index n must be at least 1 under this convention.

What does it cost?

The browser tool is free and runs locally.

Does the sequence start at F0 or F1?

It starts at F1, with F1 and F2 both equal to 1, so F3 is 2 and F10 is 55. Keep that in mind if your textbook or code counts from F0, because every position shifts by one.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/math/fibonacci

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/math/fibonacci \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n":10}'
{
  "n": 10
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.fibonacci",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

min_n1
max_n10000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The free browser tool and the paid API share one pure function, so homework demos and automated pipelines never silently diverge.

How the n-th Fibonacci number is defined and computed

Returning the value as a decimal string keeps JSON consumers honest: large Fibonacci numbers leave the safe-integer range of ordinary JavaScript numbers by F93, and a numeric type would silently round. Bounds keep n between one and ten thousand so worst-case latency stays suitable for a free in-browser tool and a lightweight Worker path.

What you send and what you get back

The error for n below one states that the Fibonacci index must be at least one so form clients and scripts can correct the input without guessing. On success the response always includes the normalized n and value as the exact n-th Fibonacci number written in decimal. Provide a required positive integer under the field n, or the aliases number or index. The value must be an integer from one through ten thousand inclusive; missing fields, non-integers, decimals, and any n below one are rejected with invalid_input and are not charged. Optionally set list to true (aliases sequence and include_sequence are accepted) to request the full prefix F1 through Fn. When list is true, the response also includes sequence: an array of n decimal strings starting with the first term. Example checks: n equals one yields value one and, if listed, sequence of a single one; n equals two yields value one and sequence one, one; n equals ten yields value fifty-five and the ten-term prefix ending in fifty-five; n equals zero or negative yields invalid_input.

Where Fibonacci calculations show up in real work

Finance and growth storytelling sometimes misuse Fibonacci-style ratios; an exact sequence endpoint does not invent market signals, but it does give educators a clean reference when they contrast true recurrence values with heuristic “Fibonacci levels.” Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Contest and homework fixtures

Generate exact F(n) strings and optional F1..Fn prefixes for olympiad problems, programming exercises, and automated answer keys.

Teaching the recurrence with real digits

Show students the full sequence as decimal strings so large terms stay exact and the F1=F2=1 convention is visible, not abstract.

What indexing does this Fibonacci calculator use?

One-based with F1 = 1 and F2 = 1. Then F3 = 2, F4 = 3, F5 = 5, and so on. Zero and negative indices are rejected.

Read the full KIT documentation →