Collatz Steps Calculator

Count Hailstone steps to 1 with peak value shown.

Math and PercentUpdated 2026-10-161 min read
Collatz Steps Calculator
Whole number 1 to 1e12.
Steps to 1
...
Peak value...
Terms including 1...

What it does

The Collatz map iterates a simple rule: halve evens, triple odds and add one. Unproven conjecture says all positive starts reach 1. Small starts finish fast, some climb high first like 27 to 9232.

The tool above takes starting n and returns steps, peak, and terms. The default 6 matches the worked example, so the page opens showing 8 steps. Type a new n to update all three results.

Steps count transitions to 1. Terms add one for the start. Peak tracks the max seen. Here 6 runs 6,3,10,5,16,8,4,2,1 for 8 steps with peak 16. Odd steps jump up, evens grind down.

Use this to explore stopping times, verify OEIS A006577 values, and test loop guards. Large starts may exceed the 10000 step cap here and report an error instead of hanging.

This page shows the rules, one full hand checked example at 6, a reference table, and practice checks that run through the tool.

How to use

  1. Type starting n as a whole number.
  2. Keep n between 1 and 1e12.
  3. Read Steps as transitions to 1.
  4. Read Peak as max value seen.
  5. Read Terms as steps plus 1.
  6. Try 27 to see long climb to 9232.

Formula

If even: n/2. If odd: 3n+1. Repeat to 1. Steps count moves, peak is max.
n
Starting positive integer.
steps
Moves to reach 1.
peak
Largest value in the run.

Conjecture unproven but checked past 2e21 per literature. This tool caps at 10000 moves and reports overflow instead of looping.

Worked example

Example: n = 6

Run Collatz from 6 to 1.

  1. Start 6 even to 3 (1).
  2. 3 odd to 10 (2).
  3. 10 to 5 (3), 5 to 16 (4).
  4. 16 to 8 (5), 8 to 4 (6), 4 to 2 (7), 2 to 1 (8).
  5. Steps 8, terms 9.
  6. Peak max of run is 16.

Reference table

Steps for sample starts
nStepsPeak
101
6816
192088
271119,232

Limits

  • Starts 1 to 1e12 here.
  • 10000 step cap. Larger runs report overflow.
  • No proof here, only iteration counts.
  • Integers only. Fractions have no Collatz form here.

Common mistakes

  • Counting terms instead of steps (off by one).
  • Skipping the +1 on odd moves.
  • Halving odd numbers by mistake.
  • Expecting peak near start. 27 peaks at 9232.
  • Running huge starts without a step cap.

Try it yourself

Quick checks. Answers sit tucked under each question.

Start 1?

Steps 0, peak 1, terms 1.

Start 27?

Steps 111, peak 9,232, terms 112.

Questions

6 steps?

8 steps to 1.

Peak?

Max seen. Here 16.

27?

111 steps with peak 9232.

Proven?

No. Open conjecture, checked very high.

Even odd?

Even halves, odd triples plus 1.

Cap?

10000 moves here.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.