Four steps, repeated
Step 1
Choose a valid number
Start with any four-digit number containing at least two different digits. Shorter entries are padded on the left, so 352 becomes 0352.
Step 2
Sort in descending order
Arrange the same four digits from largest to smallest. For 3524, this produces 5432.
Step 3
Sort in ascending order
Arrange those digits from smallest to largest. The ascending arrangement of 3524 is 2345. Leading zeroes stay in place when needed.
Step 4
Subtract and repeat
Subtract the ascending number from the descending number: 5432 − 2345 = 3087. Use that result as the next input.
A complete worked example
Starting with 3524, the first subtraction is 5432 − 2345 = 3087. Repeating the same operation gives 8730 − 0378 = 8352, then 8532 − 2358 = 6174. Once the routine reaches 6174, the next operation is 7641 − 1467 = 6174. The number therefore maps back to itself: it is a fixed point.
3524 → 3087 → 8352 → 6174
Why leading zeroes matter
The routine always keeps the original digit width. If a result is 999, a four-digit routine treats it as 0999. Its next subtraction is 9990 − 0999 = 8991. Dropping the zero would silently turn a four-digit experiment into a three-digit one and produce a different path.
Why repdigits are excluded
Numbers such as 1111 or 7777 have identical ascending and descending arrangements. Their first subtraction is zero, so they reach 0000 rather than 6174. This is why the precise rule applies to four-digit numbers containing at least two distinct digits.
Why numbers converge
Sorting removes the importance of the original digit order. Many different inputs therefore produce the same difference, and subsequent steps merge into a relatively small collection of shared paths. For four digits, those paths funnel valid inputs toward 6174 in no more than seven subtractions. The claim is not based on a visual approximation: Kaprekar.fun computes and tests all 10,000 zero-padded 4-digit inputs from 0000 through 9999.
The phenomenon is specific to a chosen digit width. Three-digit inputs with at least two distinct digits converge to 495, another fixed point because 954 − 459 = 495. Other widths can contain different fixed points or repeating cycles rather than one universal destination.