DataToolsLab
Number Theory & Statistics Calculators

Happy Number Checker

Check whether a number is happy, with the chain shown.

Loading tool…

What is Happy Numbers?

A happy number reaches 1 when replaced repeatedly by the sum of the squares of its digits: 19 → 82 → 68 → 100 → 1. An unhappy number does not wander forever — it always lands in the same cycle, 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20, which is why a sad number's answer can name the loop it fell into rather than a bare no.

How it works

Each step sums the squares of the digits, and the values visited are kept in a set so the first repeat is caught the moment it appears: reaching 1 means happy, and repeating means the loop is known. The first step is written out with its digit squares (19 → 1² + 9² = 82) because the rule is the thing being shown, and the whole chain is listed so it can be followed by hand.

  1. Enter your input. Type or paste your input into the field above — the tool responds instantly.
  2. Review the result. Output updates live as you type. Everything runs entirely in your browser.
  3. Copy or download. Use the Copy button to grab the result, or Download to save it as a file.

Examples

Realistic sample

Type or paste any realistic input — the tool computes the result locally and instantly.

Common mistakes

Expecting a server round-trip

Nothing is uploaded — every tool in this category runs entirely in your browser.

Online