Experimental

Happy Number Checker

Check whether a number is a happy number by repeatedly summing the squares of its digits until it reaches 1 or loops.

Last reviewed by the Radiatus Cloud team

Check whether a number is a happy number.

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

Check for a happy number

A happy number is a positive integer that eventually reaches one when you repeatedly replace it with the sum of the squares of its digits. This checker performs that process and tells you whether a number is happy. For example, nineteen is happy because one squared plus nine squared is eighty-two, then sixty-eight, then one hundred, then one. Numbers that are not happy fall into a cycle that never reaches one, which the tool detects.

The sequence is shown step by step so you can follow the path the number takes.

Happy and unhappy numbers

Every number is either happy or unhappy, and the unhappy ones all eventually enter the same repeating cycle that includes the number four. Happy numbers appear scattered among the integers in a pattern that looks random, which is part of their charm as a recreational mathematics curiosity. They are a popular programming exercise and a fun way to explore digit manipulation.

The checker stops as soon as it either reaches one or revisits a number, since a repeat guarantees an endless loop. All calculation happens locally in your browser.

About this tool

Because the happy number checker runs entirely in your browser, you can use it as many times as you like for free, with nothing uploaded and no sign-up required. Everything is computed locally on your own device, so it is fast and private.

Related tools

Frequently Asked Questions

What is a happy number?

A positive integer that reaches one when you repeatedly replace it with the sum of the squares of its digits.

What makes a number unhappy?

If the process enters a repeating cycle instead of reaching one. All unhappy numbers eventually hit the same loop containing four.

How does the checker detect a loop?

It remembers the numbers seen and stops as soon as one repeats, since a repeat means the sequence will never reach one.

Is 19 a happy number?

Yes. The squares of its digits sum to eighty-two, then sixty-eight, then one hundred, then one, so nineteen is happy.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Enter a positive integer to check if it is happy.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.