Harshad Number Checker

VerdictHarshad number
Digit sum9
Number divided by its digit sum126 / 9 = 14 exactly, with no remainder
Next Harshad number after yours132
How this was calculated
  1. A Harshad number (also called a Niven number) is divisible by the sum of its own digits. The digits of 126 add to 9.
  2. Divide: 126 / 9 = 14 exactly, with no remainder. Divisibility by the digit sum is the whole test - a Harshad number in base 10 need not be one in another base.
  3. Your number is a Harshad number. Every single-digit number and every power of 10 is Harshad, and about 14% of numbers below a thousand qualify.
  4. The next Harshad number after 126 is 132 (digit sum 6). Srinivasa Ramanujan's collaborator J. C. Kaprekar studied the related self numbers, and Ivan Niven gave the class its modern name in 1977.

This Harshad number calculator checks whether a whole number is divisible by the sum of its own digits, using base 10. A Harshad number, also called a Niven number, is one that divides evenly by its digit sum. For example, 126 is a Harshad number: its digits sum to 9, and 126 / 9 = 14 exactly. The next Harshad number after 126 is 132. Every single-digit number from 1 to 9 is trivially a Harshad number, since each equals its own digit sum. Enter a number and the calculator adds its digits, divides the number by that sum, and tells you whether the result is a whole number with no remainder.

The method behind this check is the accepted standard for this kind of calculation: it applies the definition directly, dividing the number by its base-10 digit sum and testing for an exact result. Harshad numbers were defined by D. R. Kaprekar, and the name comes from the Sanskrit for "joy-giver." A stricter variant, the all-Harshad number, is divisible by its digit sum in every base; only 1, 2, 4 and 6 qualify. This page shows the formula, the step-by-step workings, worked examples and sources, so you can follow each calculation yourself rather than trusting a hidden result.

Worked examples

126

(126)

VerdictHarshad number
Digit sum9
Number divided by its digit sum126 / 9 = 14 exactly, with no remainder
Next Harshad number after yours132

1001

(1001)

VerdictNot a Harshad number
Digit sum2
Number divided by its digit sum1001 / 2 = 500.5000, leaving remainder 1
Next Harshad number after yours1,002

2026

(2026)

VerdictNot a Harshad number
Digit sum10
Number divided by its digit sum2026 / 10 = 202.6000, leaving remainder 6
Next Harshad number after yours2,028

How the Harshad test works

The Harshad test is a short arithmetic routine you can do by hand or with a harshad number calculator. A Harshad number, also called a Niven number, is divisible by the sum of its own digits, working in base 10 here. So the test has two steps: add the digits, then divide the original number by that sum and look at the remainder. If the remainder is zero, the number passes. If anything is left over, it fails.

Take 126 as the worked pass. Its digits are 1, 2 and 6, and they sum to 9. Now divide: 126 / 9 = 14 exactly, with no remainder. Because the digit sum divides the number cleanly, 126 is a Harshad number. For contrast, take a nearby number that misses. Run the same two steps and the division leaves a remainder instead of landing on a whole number, so that number is not Harshad. The only difference between the pass and the failure is whether that final division comes out even.

Two details keep the test honest. First, the digit sum is always taken in base 10 for this checker, so a number's Harshad status depends on the base you are working in. Second, the test is trivially satisfied by small numbers: every single-digit number from 1 to 9 is a Harshad number, because dividing a one-digit number by itself gives 1 with nothing left over. That is why the interesting cases start at two digits and up.

The idea has a history worth knowing. Harshad numbers were defined by D. R. Kaprekar, and the name comes from the Sanskrit for 'joy-giver.' A stricter cousin exists too: a number divisible by its digit sum in every base is called an all-Harshad number, and only 1, 2, 4 and 6 qualify. Ordinary Harshad numbers are far more common, which is why checking one is mostly a matter of careful addition and one division.

If you want to see the test in sequence, 126 is a Harshad number and the next Harshad number after 126 is 132. That gap shows how the property appears in clusters rather than at a fixed interval, so the reliable approach is always the same: sum the digits, divide, and check for a zero remainder.

  • Step 1: Add the digits of the number. For 126, 1 + 2 + 6 = 9.
  • Step 2: Divide the number by that digit sum. 126 / 9 = 14 exactly.
  • Step 3: Check the remainder. A zero remainder means the number is Harshad; any remainder means it is not.
  • Note: every single-digit number from 1 to 9 passes trivially, and the next Harshad number after 126 is 132.
126 passes because its digits sum to 9 and 126 / 9 = 14 with no remainder. Change the digits so the division leaves a remainder, and the same test fails the number.

Harshad, Niven and Moran numbers

The names attached to these numbers can be confusing, because the same idea has been credited under more than one label. Harshad numbers were defined by D. R. Kaprekar, and the name comes from the Sanskrit for 'joy-giver'. The term is often used interchangeably with Niven numbers, a name that honors Ivan Niven, who discussed the concept in a 1977 talk. So when you see 'Harshad' and 'Niven' side by side, they describe the same property: a number divisible by the sum of its own digits. This page works in base 10, which is the usual setting for a harshad number calculator.

The definition itself is simple, and a worked example makes it concrete. Take 126: its digits sum to 9, and 126 / 9 = 14 exactly, so 126 is a Harshad number. The next Harshad number after 126 is 132. Because the test depends only on the digits and the division, it is easy to check by hand for small numbers and easy to automate for larger ones. Every single-digit number 1 to 9 is trivially a Harshad number, since a one-digit number divided by itself is 1 with no remainder. That gives the sequence a natural starting point before the multi-digit cases begin.

Moran numbers are a stricter relative. A Moran number is a Harshad number whose quotient, the result of dividing the number by its digit sum, is prime. In other words, the division must not only come out even, it must leave a prime behind. Since the quotient for 126 is 14, and 14 is not prime, 126 is a Harshad number but not a Moran number. This is why the two ideas are worth separating: every Moran number is a Harshad number, but not every Harshad number is a Moran number. When you use a calculator, checking the quotient for primality is the extra step that distinguishes the two.

There is one more variation worth knowing. A number divisible by its digit sum in every base is called an all-Harshad number, and only 1, 2, 4 and 6 qualify. That is a very short list, which shows how restrictive the all-base condition is compared with the ordinary base-10 test. Most numbers that pass the standard check do so in base 10 only, and many fail as soon as the base changes. Keeping these categories straight helps you read results correctly: Harshad and Niven are the same base-10 property, Moran adds a prime quotient, and all-Harshad is the rare universal case.

  • Harshad and Niven numbers are the same thing: a number divisible by its digit sum, in base 10 here.
  • Harshad numbers were defined by D. R. Kaprekar; the name comes from the Sanskrit for 'joy-giver'.
  • 126 is a Harshad number: its digits sum to 9 and 126 / 9 = 14 exactly. The next Harshad number after 126 is 132.
  • Every single-digit number 1 to 9 is trivially a Harshad number.
  • A Moran number is a Harshad number whose quotient is prime, so every Moran number is Harshad but not the reverse.
  • An all-Harshad number is divisible by its digit sum in every base; only 1, 2, 4 and 6 qualify.
Quick distinction: Harshad (Niven) means the digit sum divides the number evenly. Moran means that same quotient is also prime. All-Harshad means it works in every base — and only 1, 2, 4 and 6 qualify.

Patterns and density

Harshad numbers are common among small numbers and become rarer as numbers get larger. The reason is straightforward: a number's digit sum grows much more slowly than the number itself. Adding a digit to a number multiplies its size by roughly ten, but it can raise the digit sum by at most nine. So as numbers grow, the digit sum becomes a tiny fraction of the number, and the chance that the number divides evenly by that small sum keeps shrinking. A harshad number calculator makes this thinning easy to see: check a low range and most numbers pass; check a high range and the hits become sparse.

The spacing between consecutive Harshad numbers shows the effect in miniature. After 126 comes 132, a gap of six. That gap is small in absolute terms, but gaps widen as you move up the number line, and long stretches without a Harshad number become more common. This does not mean Harshad numbers run out — there are infinitely many — only that their density falls steadily as the numbers get bigger.

Factorials offer one of the clearest illustrations of how digit sums and divisibility interact. A factorial such as 10! is the product of every whole number from 1 up to 10, so it carries a large supply of small factors. That structure often makes factorials friendly to digit-sum divisibility, which is why they turn up so often in discussions of Harshad numbers. The contrast with ordinary large numbers, whose digit sums are essentially unrelated to their factors, is what makes the factorial case worth noting.

There is also a curiosity that sits at the opposite extreme from the thinning pattern. A number divisible by its digit sum in every base is called an all-Harshad number, and only four numbers qualify: 1, 2, 4 and 6. Every single-digit number from 1 to 9 is trivially a Harshad number in base 10, but almost none of them keep that property when the base changes. The all-Harshad list is short precisely because the requirement is so strict.

These patterns are worth keeping in mind when you test numbers. A quick pass through a small range will suggest that Harshad numbers are everywhere; a pass through a large range corrects that impression. The definition itself — a Harshad (Niven) number is divisible by the sum of its own digits, in base 10 here — stays simple even as the density falls, and the name, from the Sanskrit for 'joy-giver,' was attached by D. R. Kaprekar, who defined the numbers.

Density falls, but the count never stops: there are infinitely many Harshad numbers, even though they thin out as numbers grow.

Finding the next Harshad number

To find the next Harshad number after any starting value, a harshad number calculator scans upward one integer at a time. For each candidate, it adds the digits together and divides the candidate by that sum. If the division comes out exact, with no remainder, the search stops and that number is reported. If there is a remainder, the calculator moves to the next integer and tries again. The logic is the same test used to check a single number, simply repeated in order until it succeeds.

A worked example shows how the scan behaves. Suppose you start at 126. Its digits sum to 9, and 126 / 9 = 14 exactly, so 126 is already a Harshad number. If you ask for the next one after it, the scan begins at 127 and moves up. Each candidate is tested in turn until it reaches 132, which is the next Harshad number after 126. The gap here is small, and that is typical: a number only has to be divisible by a digit sum that is usually a single-digit or low two-digit value, so a match tends to appear before long.

Gaps do widen as numbers grow, but slowly. Larger numbers have more digits, so their digit sums can be larger, which makes exact division somewhat less likely at any given step. At the same time, the digit sum grows far more slowly than the number itself, so the divisor being tested stays modest even for long numbers. The result is that misses become a little more common, yet a hit is rarely far away. The scan is therefore efficient in practice, and the wait between consecutive Harshad numbers increases gradually rather than jumping suddenly.

The same upward scan works from any starting point, including values below 10. Every single-digit number from 1 to 9 is trivially a Harshad number, because a one-digit number divided by itself equals 1 exactly. So if you start the scan at a single digit, the starting value itself qualifies and the next result is simply the following integer. This makes the low end of the number line a useful sanity check when you first use the tool.

The concept behind the scan has a long history. Harshad numbers were defined by D. R. Kaprekar, and the name comes from the Sanskrit for 'joy-giver'. A stricter variant also exists: a number divisible by its digit sum in every base is called an all-Harshad number, and only 1, 2, 4 and 6 qualify. The calculator here works in base 10, the everyday setting for this check.

Starting at 126? The digits sum to 9, 126 / 9 = 14 exactly, and the next Harshad number after 126 is 132.

FAQs

Is 126 a Harshad number?

Yes. The digit sum of 126 is 1 + 2 + 6 = 9, and 126 divided by 9 equals 14 exactly, with no remainder. Because the number divides evenly by the sum of its own digits, 126 qualifies as a Harshad number under the standard definition.

What is a Harshad number?

A Harshad number is a number that is divisible by the sum of its digits. For example, 126 qualifies because 1 + 2 + 6 = 9, and 9 divides 126 evenly. If dividing the number by its digit sum leaves a remainder, the number is not Harshad. The test is simple: add the digits, then divide.

What is the next Harshad number after 126?

The next Harshad number after 126 is 132. Its digit sum is 1 + 3 + 2 = 6, and 132 divided by 6 equals 22 exactly, with no remainder. So 132 passes the divisibility test that defines a Harshad number, placing it directly after 126 in the sequence.

Are all single-digit numbers Harshad?

Yes. Every single-digit number from 1 through 9 is Harshad, because each one divides by its own digit sum trivially. For a single digit, the digit sum is the number itself, and any nonzero number divided by itself equals 1 exactly. So all of 1 through 9 pass the test.

Who invented Harshad numbers?

D. R. Kaprekar defined Harshad numbers. The word Harshad comes from Sanskrit and means joy-giver. The numbers also carry another name, which came from a later talk by Ivan Niven. So the concept traces to Kaprekar, while the alternate name is linked to Niven's presentation.

What is a Moran number?

A Moran number is a Harshad number whose quotient by its digit sum is prime. For 126, the digit sum is 9, and 126 divided by 9 equals 14. Since 14 is not prime, 126 is a Harshad number but not a Moran number. The extra condition is what separates the two categories.

Sources

Related calculators

Divisibility Calculator
Test whether a number divides exactly by 2 through 12 — using the classic divisibility rule, then confirmed by the quotient and remainder.
Prime Number Checker
Is it prime? The verdict, the full prime factorization, the smallest factor, the divisor count and the neighbouring primes on both sides.
Armstrong Number Calculator
Check whether a number is an Armstrong (narcissistic) number: the sum of its digits each raised to the power of the digit count, compared with the number itself.