Experimental

Kaprekar Routine Calculator

Run Kaprekar routine on a four-digit number and watch it reach the famous Kaprekar constant 6174 in at most seven steps.

Last reviewed by the Radiatus Cloud team

Run Kaprekar routine and reach the constant 6174.

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

Discover the Kaprekar constant

Kaprekar routine is a remarkable number trick for four-digit numbers. Take any four-digit number with at least two different digits, arrange its digits in descending and then ascending order, and subtract the smaller from the larger. Repeat the process on the result, and you will always reach the number six thousand one hundred and seventy-four, the Kaprekar constant, in at most seven steps. Once you reach it, the routine stays there forever, since the process on 6174 gives 6174 again.

This calculator runs the routine and shows each subtraction step on the way to the constant.

A magical fixed point

Discovered by the Indian mathematician D. R. Kaprekar, this constant is a striking example of how simple arithmetic can hide surprising structure. No matter which qualifying four-digit number you start with, the sequence funnels into 6174, making it an attractor for the routine. The only exceptions are repdigits like 1111, where all digits are the same, which collapse to zero.

Three-digit numbers have their own Kaprekar constant, 495, following the same kind of rule. Exploring different starting numbers shows how quickly they all converge. All calculation happens locally in your browser.

Related tools

Frequently Asked Questions

What is the Kaprekar constant?

It is 6174, the number that Kaprekar routine always reaches for any four-digit number with at least two different digits, within seven steps.

How does the routine work?

Arrange the digits in descending and ascending order, subtract the smaller from the larger, and repeat on the result until you reach 6174.

Why do repdigits not work?

Numbers like 1111 have identical digits, so the descending and ascending arrangements are equal and the difference is zero, not 6174.

Is there a three-digit version?

Yes. Three-digit numbers reach the constant 495 under the same kind of routine, and other digit lengths behave differently.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Enter a four-digit number with at least two different digits.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.