Calculators

Harshad Number Calculator

Check whether a positive integer is divisible by its digit sum with exact Harshad (Niven) number arithmetic in your browser.

A Harshad (Niven) number is a positive integer divisible by the sum of its decimal digits. Enter up to 1000 digits; leading zeros are removed. Calculations stay in your browser.

Enter a positive integer to check its digit sum and divisibility.

How to check a Harshad number

A Harshad number, also called a Niven number, is a positive integer divisible by the sum of its base-10 digits. For 18, the digit sum is 1 + 8 = 9 and 18 divided by 9 is 2 with remainder zero, so 18 qualifies. For 19, the digit sum is 10 and the remainder is 9, so it does not qualify. Every positive single-digit integer is a Harshad number. Zero is excluded because division by its digit sum would be undefined. Enter 1 to 1000 decimal digits without signs, separators, decimals or exponent notation. Surrounding whitespace is accepted and leading zeros are removed before counting digits. Exact integer arithmetic preserves all input digits. The quotient is the whole-number quotient, and the remainder shows whether the division is exact: number = digit sum × quotient + remainder. This checks divisibility by one digit sum; it does not repeatedly sum the digits like a digital root calculation. All calculations stay in your browser.

Frequently Asked Questions

Everything you need to know about this tool, how it works, and privacy.

What is a Harshad number?

A positive integer divisible by its base-10 digit sum. For example, 18 has digit sum 9 and divides exactly by 9.

Is zero a Harshad number?

No. This calculator uses the positive-integer definition. Zero has digit sum zero, so the required division is undefined.

What does the quotient mean?

It is the whole-number quotient after division by the digit sum. The remainder is zero exactly when the number is Harshad.

Do leading zeros change the result?

No. Leading zeros are removed, so 00018 is checked as 18.

Are large inputs rounded or uploaded?

No. Inputs up to 1000 digits use exact integer arithmetic locally in your browser. Signs, decimals, separators and exponent notation are rejected.