Kaprekar's Routine Calculator
See how many steps a number takes to reach 6174.
Result
How it is calculated
Kaprekar's routine works on a four-digit number. Pad it with leading zeros to four digits, sort the digits from largest to smallest to get D, from smallest to largest to get A, and compute D - A. The difference is padded to four digits again and the step is repeated until the number 6174 appears. The tool reports how many subtractions were needed.
Numbers from 0 to 9999 are accepted, so 12 is treated as 0012. Numbers whose four digits are all identical (0000, 1111 ... 9999) have no result, since they collapse to 0 and never reach 6174. Starting from 6174 itself needs 0 steps.
Worked example
Start with 3524. Step 1: 5432 - 2345 = 3087. Step 2: 8730 - 0378 = 8352. Step 3: 8532 - 2358 = 6174. The number 6174 is reached, so the answer is 3 steps, ending at the constant 6174.
Common mistakes
- Dropping the leading zero: 0378 must stay four digits, and leaving it as 378 changes how the digits are sorted in later steps.
- Trying numbers with four identical digits such as 1111; they give 0 after one step and the tool returns nothing.
- Entering a number with more than four digits or a negative number, which is outside the supported range.
- Expecting the same step count for numbers that look similar: 3524 takes 3 steps but 2111 takes 5.
- Applying the routine to 3-digit or 5-digit numbers and expecting 6174; those cases lead to other constants or cycles, and this tool only handles four digits.
About this calculator
This calculator runs Kaprekar's routine on a 4-digit number: arrange its digits in descending and ascending order, subtract the smaller from the larger, and repeat — a process that reaches the constant 6174 (Kaprekar's constant) within at most 7 iterations for any 4-digit number with at least two different digits.
Recreational mathematicians and students use it to explore this quirky self-referential property discovered by D. R. Kaprekar in 1949, watching how quickly any starting number converges.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments