Happy Number Finder

Check if repeatedly summing squared digits leads a number to 1.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

A happy number is a positive integer that eventually reaches 1 when you repeatedly replace it with the sum of the squares of its digits. For example, 19 is happy: 1² + 9² = 82, 8² + 2² = 68, 6² + 8² = 100, 1² + 0² + 0² = 1. Numbers that never reach 1 fall into a fixed repeating loop instead (most commonly the cycle 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4) and are called "unhappy."

Happy numbers are a classic topic in recreational mathematics and a common programming-practice exercise because detecting the cycle requires either memorizing the known unhappy loop or using a cycle-detection technique like Floyd's algorithm (the same "tortoise and hare" method used to detect loops in linked lists). They show up in coding-interview prep and math-education contexts far more than in any applied field, which is part of their appeal — a simple rule with a surprisingly structured pattern underneath.

This calculator repeats the digit-square-sum process on any number you enter and shows every step until it lands on 1 (happy) or falls into the repeating loop (not happy).

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators