Kaprekar's Constant Explorer

Want to see the rest? Click here.
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:

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

  1. Each step of the process
  2. How the digits are rearranged
  3. 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.