Calculators
Happy Number Calculator
Check whether a positive integer is happy with exact digit-square steps and repeating cycle detection, privately in your browser.
Repeatedly add the squares of decimal digits. A happy number reaches 1; other positive integers enter a repeating cycle. Enter up to 1000 digits. Calculations stay in your browser.
How happy numbers work
A happy number is a positive integer that reaches 1 when you repeatedly replace it with the sum of the squares of its decimal digits. For 19, the sequence is 19 → 82 → 68 → 100 → 1, so 19 is happy after four rounds. If a value repeats before reaching 1, the sequence will repeat forever and the starting number is not happy. For example, 2 enters the cycle 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4. The calculator reports the cycle starting at the first repeated sequence value and counts all rounds through the first repeat. The number 1 is happy with zero rounds; zero is excluded because happy numbers are positive. Enter 1 to 1000 decimal digits without signs, separators, decimals or exponent notation. Leading zeros are removed and surrounding whitespace is accepted. Each digit square is at most 81, so even a 1000-digit input produces a first sum of at most 81000; the input is never converted to a floating-point integer. All steps are exact and run locally in your browser. This is a base-10 calculation and differs from the digital root, which adds digits without squaring them.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
What is a happy number?
A positive integer is happy if repeatedly summing its squared decimal digits reaches 1. For example, 19 → 82 → 68 → 100 → 1.
How does the calculator know a number is not happy?
It remembers each sequence value. A repeated value means the sequence has entered a cycle and will never reach 1. The repeated cycle is shown in the result.
Are 1 and zero happy numbers?
One is happy and needs zero rounds. This tool rejects zero because the definition uses positive integers.
What does the round count include?
It counts digit-square operations until reaching 1 or the first repeated value. Leading zeros are removed before starting.
Can I enter a large integer?
Yes. Enter up to 1000 digits. Each digit is squared separately, so the original integer is never rounded. Signs, decimals, separators and scientific notation are rejected.
Are my inputs sent to a server?
No. The calculation and step trace run entirely in your browser.