Happy Number Checker
Enter any positive integer to find out if it is a happy number, with each iteration step shown.
Check a Number
Enter a positive integer to see whether it is happy and trace every step.
Iteration steps
Try an example
First 20 Happy Numbers
Click any number below to check its sequence.
Unhappy cycle (all non-happy numbers enter this loop)
4→16→37→58→89→145→42→20 → 4 …
Algorithm: replace the number with the sum of squares of its digits. Repeat until the result is 1 (happy) or 4 (unhappy).
Example: 19 → 1²+9² = 82 → 8²+2² = 68 → 6²+8² = 100 → 1²+0²+0² = 1 ✓
Summary
Enter any positive integer to find out if it is a happy number, with each iteration step shown.
How it works
- Enter a positive integer and click Check.
- The tool replaces the number with the sum of the squares of its digits, then repeats.
- If the sequence reaches 1, the number is happy.
- If it reaches 4 (which loops forever through the unhappy cycle), the number is not happy.
- Every step is listed so you can follow the full path to the result.
Use cases
- Verify whether a specific number is happy for a math homework problem.
- Explore how quickly different numbers reach 1 or enter the unhappy cycle.
- Find all happy numbers in a range using the built-in list.
- Demonstrate the digit-square-sum algorithm in a classroom setting.
Frequently Asked Questions
Last updated: 2026-06-13 ·
Reviewed by Nham Vu