Enter a 4-digit number and click “Run Kaprekar” to see step-by-step reasoning here.
What is happening?
This tool follows a mathematical process called Kaprekar’s Routine.
The rule is:
- Choose a 4-digit number (at least 2 digits must be different)
- Arrange digits in descending order
- Arrange digits in ascending order
- Subtract the smaller number from the larger
- Repeat the process
Why this is interesting
Almost every valid number will eventually reach the same result:
6174
Once it reaches 6174, it stays there forever:
7641 − 1467 = 6174
What this program shows you
- Each step of the process
- How the digits are rearranged
- How many steps it takes to reach 6174
This constant was discovered by Kaprekar, and it behaves like a mathematical “black hole” — numbers always fall into it.