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: .

A whole number from 1 up to 9,007,199,254,740,991.
Up to 1,000,000.
My ToolboxYour inputs are saved in this browser only.

Result

Result
19 is a happy prime – it reaches 1 after 4 steps.
Steps
StepSum of the squared digits
11² + 9² = 82
28² + 2² = 68
36² + 8² = 100
41² + 0² + 0² = 1
Happy numbers
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
Calculated by repeating the sum of the squares of the digits (OEIS A007770) until the result is 1.

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

NumberSequenceResult
77 → 49 → 97 → 130 → 10 → 1happy after 5 steps
1919 → 82 → 68 → 100 → 1happy after 4 steps
2323 → 13 → 10 → 1happy after 3 steps
44 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4unhappy (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?

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

As of: · Editorial policy

Related tools