Collatz sequence
Generate the Collatz (3n+1) sequence for a number and see how many steps it takes to reach 1.
Collatz sequence
Enter a positive whole number and this tool generates its Collatz sequence — repeatedly halving even numbers and applying 3n+1 to odd ones until the sequence reaches 1. It is also known as the hailstone sequence, because values rise and fall unpredictably before crashing down, and it is the basis of the still-unproven Collatz conjecture: that every positive integer eventually reaches 1 this way.
Turn on "Support very large numbers" to compute exact results for starting numbers beyond standard 64-bit precision, using arbitrary-precision arithmetic instead of rounding. "Show calculation steps" prints every individual halving or 3n+1 operation instead of just the final list, which is useful for checking the math by hand or for teaching the rule. "Batch mode" accepts one starting number per line and prints a one-line summary — step count, peak value, and the peak-to-start ratio — for each. Output format switches the sequence between arrow-separated, comma-separated and one-value-per-line.
Sequences can grow far larger than their starting number before collapsing — 27 takes 111 steps and peaks at 9,232 — so the tool tracks the peak value and its ratio to the starting number, with the ratio's decimal precision under your control. A safety limit stops any sequence that runs unexpectedly long, and generated output is capped so a huge batch can never freeze the tab.
Everything runs locally in your browser — no number you enter is ever sent anywhere. Copy the result, download it as a .txt file, or send the output back into the input to keep exploring from wherever the sequence leads.