What Is Kaprekar's Constant?
Kaprekar's constant is the number 6174. It appears when a simple digit-sorting routine is applied repeatedly to a four-digit number containing at least two different digits. The process was described by Indian mathematician D. R. Kaprekar, whose recreational discoveries showed how surprising structure can emerge from elementary arithmetic.
The constant is a fixed point: arranging its digits gives 7641 and 1467, and 7641 − 1467 returns 6174. Once a path arrives there, every later step stays there too.
How Kaprekar's Routine Works
Take the same four digits, arrange them from largest to smallest, arrange them again from smallest to largest, and subtract the smaller value from the larger one. Preserve leading zeroes so the calculation always remains four digits, then repeat with the result.
Learn how Kaprekar's routine works →Why Does 6174 Work?
Sorting makes many differently ordered inputs equivalent. Their subtraction results merge into shared paths, and those paths funnel toward 6174. Exhaustively calculating all 10,000 zero-padded 4-digit inputs from 0000 to 9999 confirms that every non-repdigit reaches it within seven iterations. Repdigits such as 1111 instead subtract immediately to 0000.