Collatz Steps Calculator
Enter any positive integer to find how many steps the Collatz sequence takes to reach 1 — halving even numbers, applying 3n + 1 to odd ones — plus the highest value it climbs to.
Steps and peak in one go
Enter a starting number and instantly get the step count to reach 1 and the highest intermediate value — for example, 27 takes 111 steps and peaks at 9,232.
Integers only, starting from 1
The Collatz rule is defined for positive whole numbers. Enter a value of 1 or greater; decimals and negatives return no result.
What is the Collatz conjecture?
The 3n + 1 problem
The Collatz conjecture — also called the 3n + 1 problem — is one of the most famous unsolved problems in mathematics. Starting from any positive integer, you repeatedly apply two simple rules: if the number is even, halve it; if it is odd, multiply it by 3 and add 1. According to the conjecture, every starting number eventually reaches 1, no matter how long the journey takes. This calculator counts how many steps that journey requires and records the highest value visited along the way.
Enter a positive whole number to find its Collatz step count and the peak value its sequence reaches before descending to 1.
The rule has two branches depending on whether the current value is even or odd. Apply it repeatedly until the sequence reaches 1.
if n is even: next = n ÷ 2 — if n is odd: next = 3 × n + 1Take 27 as a worked example. It is odd, so the first step gives 3 × 27 + 1 = 82. That is even, so the next step gives 82 ÷ 2 = 41. The sequence keeps alternating and rising until it climbs all the way to 9,232 — more than 340 times the starting value — before tumbling back down in a long descent and finally hitting 1 after exactly 111 steps. The calculator counts each application of the rule as one step and records the largest number seen at any point.
The step count tells you how long the Collatz journey is for your chosen starting number. A count of 0 means you started at 1 — the sequence is already done. Small numbers can have surprisingly long journeys: 27 takes 111 steps even though it is less than 30. The peak value shows how high the sequence climbs before its final descent; for many numbers the peak is many times larger than the start. These two figures together reveal the character of the sequence — a short flat path or a dramatic spike followed by a long slide. Numbers that are powers of 2 (2, 4, 8, 16, …) have especially short journeys because every step halves them directly to 1. Numbers just above a power of 2 tend to have longer paths.
The calculation is exact for every integer in the supported range, but there are a few things to keep in mind.
Conjecture, not theorem — and large intermediates
The Collatz conjecture is unproven in general: no one has yet shown mathematically that every positive integer eventually reaches 1. In practice, the conjecture has been verified by computer for all starting values up to at least 2^68 (roughly 295 quintillion), far beyond this calculator's input limit of one billion, so every accepted input is guaranteed to terminate. The calculator also caps iteration at 100,000 steps as a safety measure — a limit that is never reached for inputs in the supported range. Intermediate values can grow much larger than the starting number (27 peaks at 9,232), so very large starting values may produce peaks that exceed standard integer storage — the calculator handles this correctly within JavaScript's safe integer range.