About the Fibonacci Sequence Generator
The Fibonacci Sequence Generator lists the first n terms of the sequence 0, 1, 1, 2, 3, 5, 8, 13..., where each number is the sum of the two before it. Drag the slider to choose anywhere from 1 to 1,000 terms and copy the result as a comma-separated list. Every value is exact, even the 1,000th term, which has 209 digits.
How it works
The generator starts with two values, a = 0 and b = 1. On each step it records a, then replaces the pair with (b, a + b). Repeating that n times produces the first n Fibonacci numbers: 0, 1, 1, 2, 3, 5, and so on. This iterative method takes one addition per term, so even 1,000 terms appear instantly.
Ordinary JavaScript numbers can only represent integers exactly up to about 9 quadrillion, which Fibonacci passes at term 79. To avoid that, the tool uses BigInt, which stores integers of any size. The copy button joins all terms with a comma and a space, ready to paste into a spreadsheet, a test file, or a document.
How to use
- 1
Drag the How many numbers slider to the number of terms you want (1 to 1,000).
- 2
Scroll through the list of terms shown below.
- 3
Click the copy button next to Copy as comma-separated list to copy every term.
Worked examples
Default view
The first 15 terms.
Fifty terms
A programmer checking a loop.
One hundred terms
Testing big-number handling.
Frequently asked questions
How is each number in the Fibonacci sequence calculated?+
Each number is the sum of the two preceding numbers, starting from 0 and 1, so the sequence goes 0, 1, 1, 2, 3, 5, 8, and so on.
Where does the Fibonacci sequence show up in nature?+
It's often cited in the arrangement of leaves, the spirals of sunflower seeds and pine cones, and the number of petals on many flowers. Many examples are approximate rather than exact, but the pattern is common.
Are very large terms accurate?+
Yes. The tool uses arbitrary-precision integers, so every digit is exact. The 1,000th term in the list has 209 digits.
Does the sequence start with 0 or 1?+
This generator starts with 0, followed by 1, 1, 2, 3. Some books start with 1, 1, so shift by one position if your source does.
What are Fibonacci numbers used for in programming?+
They are classic examples for teaching recursion, memoization, and dynamic programming, and they appear in Fibonacci heaps, Fibonacci search, and agile estimation scales.