Enter any positive integer, watch 3n+1 run to 1 — full hailstone sequence, stopping time, and peak, exact via BigInt
- Runs locally
- Category Developer & DevOps
- Best for Formatting, validating, shrinking, or inspecting code-adjacent text.
27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1
What this tool does
A 3n+1 calculator for the Collatz conjecture: pick any positive whole number and the tool runs the rule until it lands on 1 — if the number is even, halve it; if it is odd, triple it and add one. The path it traces is the hailstone sequence, named because the values bounce up and down like a hailstone in a cloud before they finally fall to 1. You get three readouts at once: the complete sequence, the stopping time (how many steps it takes to reach 1), and the peak (the largest value the path ever hits). Try 27 and watch it climb to 9232 over 111 steps before crashing down — a tiny seed with a wild orbit. Everything is computed with BigInt, so the peaks of numbers like 27 or 97 stay exact instead of rounding off the way ordinary JavaScript numbers would past 2^53. One click copies the whole sequence, and the URL carries your starting number so a shared link reopens the exact same run. 100% in your browser, nothing uploaded.
Tool details
- Input
- Numbers
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy + Preview
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 12 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Developer & DevOps · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How Collatz Conjecture Calculator fits into your work
Use it in the small gaps between coding, reviewing, debugging, and shipping.
Developer jobs
- Formatting, validating, shrinking, or inspecting code-adjacent text.
- Preparing snippets for documentation, tickets, commits, or handoff.
- Checking a small payload quickly without switching tools.
Developer checks
- Run irreversible transforms like minify or obfuscate on a copy.
- Keep secrets out of pasted snippets unless the tool explicitly stays local.
- Use your normal tests or linter before shipping transformed code.
Good next steps
These links move the current task into a more complete workflow.
- 1 Fibonacci Generator First N terms, a range, or the nth value, with running sum and golden-ratio convergence, exact via BigInt, all in your browser Open
- 2 Number Sequence Generator Generate a list of numbers from start to end by step or count, with zero-padding, prefix, suffix and any separator, all in your browser Open
- 3 GCD & LCM Calculator GCD + LCM of any list of integers — Euclidean steps, prime factorization, prime-factor table — exact BigInt math, browser-only Open
Real-world use cases
Explore the 3n+1 problem for a math class
A teacher introducing unsolved problems wants students to feel how wild a simple rule can get. Have each student pick a starting number under 100, run it here, and write down its stopping time and peak. The class quickly notices there is no pattern: 26 falls in 10 steps, but its neighbour 27 takes 111 and spikes to 9232. The shared URL lets a student send their favourite seed straight to the teacher.
Check a hand-computed sequence
You worked out the orbit of 97 on paper and want to confirm it. Paste 97 in, and the tool gives the full path, the step count, and the peak, so you can compare your hand work line by line. Because the values are exact BigInt, even the tall peaks match what a careful computation gives rather than a rounded approximation.
Hunt for long stopping times
You are curious which small numbers take the most steps to reach 1. Run 27, 31, 47, 54, 73, 97 and compare their stopping times — these are the classic record-holders under 100. Copy each sequence into a notes file and you have a quick table of which seeds produce the longest hailstone flights, with the peak listed alongside.
Generate sequence data for a visualization
Building a plot or an animation of hailstone paths? Run a seed, copy the full comma-separated sequence, and paste it straight into your plotting code or a spreadsheet. The copy button hands you clean, exact integers with no scientific notation, so a 9232 peak comes across as 9232, not 9.232e3.
Common pitfalls
Counting steps off by one. The stopping time here counts every operation until the value first equals 1, so 1 itself is the endpoint, not a step. For 6 there are 8 steps and the sequence has 9 entries because the starting number and the final 1 are both listed. If your hand count is one higher, you probably counted the starting number as a step.
Expecting small numbers to be tame. People assume a seed under 100 settles fast, then 27 takes 111 steps and peaks at 9232. There is no relationship between how small the seed is and how long or how high its orbit runs, so do not be surprised by a tiny number with a huge peak.
Feeding in zero, a negative, or a fraction. The rule is defined for positive integers only. Zero loops on itself and negatives fall into different cycles, so the tool treats anything that is not a positive whole number as invalid and returns nothing rather than spinning. Enter 1 or larger, with no decimal point.
Privacy
Every step of the 3n+1 rule, the step count and the peak are plain JavaScript running in your browser tab. The starting number never leaves the page and nothing about your runs is logged. The one thing to know: the shareable URL puts your starting number in the query string, so a link you paste into chat records that number in the recipient server's access log. That is just a small integer, but if you would rather not share it, use the copy button on the sequence instead of the URL.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only
- Age Difference Calculator The exact gap between two birthdays — years/months/days, percentage, and the date one person is twice the other's age — browser-only