Happy Number Checker
Is it a happy number? Enter any whole number and this checker sums the squares of its digits again and again, shows each step, tells you whether it ends at 1 and lists all happy numbers up to a limit of your choice.
Example: Number to check 19 · List happy numbers up to 100 → Result: 19 is a happy prime – it reaches 1 after 4 steps.. Source: OEIS A007770, Happy numbers: trajectory under the sum of squares of digits map (A003132) includes 1; b-file with 143 071 terms up to 1 000 000 (read 15.10.2026). Updated: .
How it is calculated
A happy number reaches 1 when you keep replacing it by the sum of the squares of its digits. 19 is happy: 1² + 9² = 82, 8² + 2² = 68, 6² + 8² = 100, 1² + 0² + 0² = 1. Every other number ends in the loop 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4 and is called unhappy.
Examples
| Number | Sequence | Result |
|---|---|---|
| 7 | 7 → 49 → 97 → 130 → 10 → 1 | happy after 5 steps |
| 19 | 19 → 82 → 68 → 100 → 1 | happy after 4 steps |
| 23 | 23 → 13 → 10 → 1 | happy after 3 steps |
| 4 | 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4 | unhappy (loop) |
The number of steps is called the height. The order of digits and any zeros do not matter, because the sum of squares stays the same: 19, 91 and 109 are all happy.
How many are there?
- 20 happy numbers up to 100: 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100.
- 143 up to 1,000 and 143,071 up to 1,000,000 (OEIS b-file) – roughly one in seven.
- Happy primes are both happy and prime, such as 7, 13, 19, 23 and 31.
Similar puzzles with digits and repeated steps: the Collatz conjecture calculator and the digit sum calculator.
Why every number ends at 1 or in the loop
A number with four or more digits always gets smaller in one step (9999 gives only 4 × 81 = 324), so the sequence soon stays below 1,000 and must repeat. Checking all values there shows only two endings: the fixed point 1 or the eight-number loop through 4.
Frequently asked questions
What is a happy number?
A number that reaches 1 when you repeatedly replace it by the sum of the squares of its digits. 7 is happy: 7 → 49 → 97 → 130 → 10 → 1.
Is 4 a happy number?
No. 4 leads to 16, 37, 58, 89, 145, 42, 20 and back to 4 – the loop in which every unhappy number ends.
How many happy numbers are there below 100?
20, from 1, 7 and 10 up to 97 and 100. Up to 1,000 there are 143.
What is a happy prime?
A number that is both happy and prime, such as 7, 13, 19, 23, 31 and 79.
Is 10 a happy number?
Yes, in one step: 1² + 0² = 1. The same holds for 100, 1,000 and every power of 10.
Sources and legal basis
- OEIS A007770, Happy numbers: trajectory under the sum of squares of digits map (A003132) includes 1; b-file with 143 071 terms up to 1 000 000 (read 15.10.2026)
- Wikipedia, Happy number: unhappy numbers end in the cycle 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4; 143 happy numbers up to 1000 (read 15.10.2026)
- Wikipedia (de), Fröhliche Zahl: German term “fröhliche Zahl” for happy number, single eight-number cycle 4 → … → 4 (read 15.10.2026)
As of: · Editorial policy
Related tools
- Collatz conjecture calculatorCollatz conjecture calculator: steps to reach 1, peak value, even and odd steps, the full sequence and record-holding start numbers up to a limit.
- Digit Sum CalculatorDigit sum calculator with steps: add the digits, see the digital root and the alternating digit sum, and check divisibility by 2 to 11 for any whole number.
- Factor Calculator – Find All DivisorsFactor calculator: enter a number and see all its factors, factor pairs, count and sum at once – plus common factors, GCF and LCM for two numbers.
- Prime Number CalculatorPrime number calculator: list all primes up to 10 million, check whether a number is prime or find the nth prime – with twin primes, gaps and working.
- Prime Factorization CalculatorPrime factorization calculator with steps: factor any number up to one trillion into primes, see the factor tree, test for primality and count divisors.
- Fibonacci calculatorFibonacci calculator for the nth number up to F(20000), the sequence as a list, a check whether a number belongs, and its Zeckendorf form. Free and exact.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- SGPA calculator (grades and credits)SGPA calculator for Indian universities: enter each course with its grade and credits to get your semester grade point average by the UGC formula, step by step.
- Microscope magnification calculator: total magnification and real sizeMicroscope magnification calculator: total magnification = objective × eyepiece, plus the real size of a specimen from the size of its image or drawing.