Worked Examples of Kaprekar’s Routine
Below are eleven fully worked examples of Kaprekar’s routine in action. Each one starts with a different four-digit number and shows every step of the subtraction process until 6174 appears. They demonstrate the full range of convergence speeds, from a single iteration up to the theoretical maximum of seven.
Example 1: 1467 (1 step)
7641 − 1467 = 6174 ✓
The simplest case. The Kaprekar map’s output depends only on the digit multiset, so any rearrangement of 6174’s digits — 1467, 1674, 4176, 7164, and twenty other permutations — reaches 6174 after a single subtraction.
Example 2: 3087 (2 steps)
8730 − 0378 = 8352 8532 − 2358 = 6174 ✓
After one iteration, 3087 becomes 8352 — whose digit multiset {2, 3, 5, 8} is itself a one-step input for 6174. Two subtractions and we are there.
Example 3: 1234 (3 steps)
4321 − 1234 = 3087 8730 − 0378 = 8352 8532 − 2358 = 6174 ✓
A classic demonstration. Three iterations from a simple starting point.
Example 4: 2026 (6 steps)
6220 − 0226 = 5994 9954 − 4599 = 5355 5553 − 3555 = 1998 9981 − 1899 = 8082 8820 − 0288 = 8532 8532 − 2358 = 6174 ✓
The year this website was created, taking six iterations.
Example 5: 1999 (6 steps)
9991 − 1999 = 7992 9972 − 2799 = 7173 7731 − 1377 = 6354 6543 − 3456 = 3087 8730 − 0378 = 8352 8532 − 2358 = 6174 ✓
Six iterations — longer than most examples here, but comfortably inside the seven-step bound. Heavily-skewed starting numbers like 1999 (three of the same digit) tend towards the longer end of the range.
Example 6: 1000 (5 steps, edge case with leading zeros)
1000 − 0001 = 0999 9990 − 0999 = 8991 9981 − 1899 = 8082 8820 − 0288 = 8532 8532 − 2358 = 6174 ✓
Leading zeros are preserved throughout the routine. Treating 0999 as a four-digit number (rather than 999) is essential.
Example 7: 2111 (5 steps, edge case with near-repdigits)
2111 − 1112 = 0999 9990 − 0999 = 8991 9981 − 1899 = 8082 8820 − 0288 = 8532 8532 − 2358 = 6174 ✓
Another demonstration that leading zeros must be retained.
Example 8: 9831 (7 steps — the maximum)
9831 − 1389 = 8442 8442 − 2448 = 5994 9954 − 4599 = 5355 5553 − 3555 = 1998 9981 − 1899 = 8082 8820 − 0288 = 8532 8532 − 2358 = 6174 ✓
This is one of the longest-running starting numbers. Seven iterations is the proven upper bound for Kaprekar’s routine applied to four-digit numbers.
Example 9: 4510 (5 steps)
5410 − 0145 = 5265 6552 − 2556 = 3996 9963 − 3699 = 6264 6642 − 2466 = 4176 7641 − 1467 = 6174 ✓
Example 10: 8315 (5 steps)
8531 − 1358 = 7173 7731 − 1377 = 6354 6543 − 3456 = 3087 8730 − 0378 = 8352 8532 − 2358 = 6174 ✓
Example 11: 6174 itself
7641 − 1467 = 6174 ✓
Once you arrive at 6174, the routine produces 6174 forever. It is a fixed point — the only four-digit fixed point in the entire system.
Try Your Own
Want to test a specific number? Head back to the solver on the homepage and enter anything with at least two different digits. For the three-digit analogue, try the 495 solver.