ForHosting KIT · Math

Armstrong number checker

153 is an Armstrong number: it has three digits, and 1 + 125 + 27, the cubes of 1, 5 and 3, add back up to 153. Enter any non-negative whole number to see each digit, its power and the total. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
N
153
You get
Digit count
3
Digits
1, 5, 3
Power sum
153

An Armstrong number—also called a narcissistic number in base ten—is a non-negative integer equal to the sum of its own decimal digits each raised to the power of how many digits it has. Classic examples include one hundred fifty-three (one cubed plus five cubed plus three cubed) and nine thousand four hundred seventy-four. Single-digit values zero through nine are trivially Armstrong because each digit raised to the first power is itself.

What an Armstrong (narcissistic) number is

Write a non-negative integer n in decimal and let k be the count of its digits. Raise every digit to the k-th power, add those powers, and ask whether the total equals n. If it does, n is an Armstrong number—also known as a perfect digital invariant or narcissistic number for base ten.

With three digits the powers are cubes: one hundred fifty-three works because one cubed is one, five cubed is one hundred twenty-five, three cubed is twenty-seven, and one plus one hundred twenty-five plus twenty-seven is one hundred fifty-three. Four-digit examples use fourth powers; the famous nine thousand four hundred seventy-four satisfies nine to the fourth plus four to the fourth plus seven to the fourth plus four to the fourth. Single-digit numbers always pass because the digit count is one and d to the first equals d.

Zero is treated as a one-digit value, so zero to the first is zero and the test succeeds. Numbers such as ten fail: one squared plus zero squared is one, not ten. This definition is fixed and deterministic—there is no sampling, randomness, or approximate arithmetic.

Programming contest and interview prep validators

Assert candidate solutions for classic Armstrong-number problems without reimplementing digit extraction and integer powering in every language harness.

Teaching demos of digit-wise number properties

Project the terms array in class so learners see each digit, the shared exponent, the powered value, and the final comparison in one response.

What is an Armstrong number?

A non-negative integer equal to the sum of its digits each raised to the power of the digit count. Example: 153 = 1³ + 5³ + 3³.

Is an Armstrong number the same as a narcissistic number?

In base 10, yes for this tool: both names refer to the same digit-power identity. Other bases are out of scope here.

Is the Armstrong number checker free?

The browser tool is free and runs locally.

Why is every single-digit number an Armstrong number?

A one-digit number has a digit count of one, so its only digit is raised to the first power, which leaves it unchanged. That is why 0 through 9 all pass the test.

Why is 10 not an Armstrong number?

It has two digits, so each one is squared: 1 squared plus 0 squared is 1, not 10. The powered digits must add up to the number itself for the test to pass.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/numth/armstrong-number

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/numth/armstrong-number \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n":153}'
{
  "n": 153
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "numth.armstrong_number",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_n999999999999999
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This capability extracts digits, computes the powered sum with pure integer arithmetic, and returns a clear boolean plus every intermediate term so students, teachers, and script authors can audit the check without a computer-algebra system or opaque library.

What an Armstrong (narcissistic) number is

The endpoint never invents a partial digit list or rounds intermediate powers; every contribution is an integer product of a digit with itself k times.

How to call the API and what comes back

Use it from homework pipelines, programming-contest validators, interview-prep sandboxes, or any workflow that needs a reproducible narcissistic-number check without installing specialized number-theory packages on every machine. Send a JSON body with a single required field n—a whole number at least zero and at most nine hundred ninety-nine trillion nine hundred ninety-nine billion nine hundred ninety-nine million nine hundred ninety-nine thousand nine hundred ninety-nine (fifteen nines), chosen so every value stays inside safe JavaScript integers. Aliases number and value are accepted for the same field. On success the response includes n as accepted, digit_count, digits as an ordered array from most to least significant, terms as objects each with digit, power, and value, power_sum as the total of those values, and is_armstrong as a boolean comparing power_sum to n. Failed validation—missing n, a non-integer, a fraction, a value above the published limit, or any negative number—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request (unit item with zero marginal unit price).

Practical tips, limits, and related searches

If you need multiprecision candidates with dozens of digits, use a dedicated big-integer stack—this lightweight parse capability is built for interactive checks and teaching-sized inputs. When teaching, prefer examples that show both outcomes: one hundred fifty-three and three hundred seventy as true three-digit cases, ten or one hundred as false cases, and a negative input to demonstrate the hard rejection path. Sibling number-theory landings in this kit target other intents such as aliquot sums or modular exponentiation; this page is specifically for people searching whether a given integer is Armstrong or narcissistic. Keep n within the published safe-integer range so digit extraction and integer powering stay exact on the Worker and in the browser. Because terms lists every digit contribution, students can recompute each power by hand and match the API line by line. Do not treat the boolean alone as a black box—pair it with power_sum and digit_count when grading submissions so partial credit or wrong digit-count assumptions are easy to diagnose. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when users type bad values while learning the contract.

Homework: verify Armstrong and narcissistic number answers

Give students an integer and check their hand-computed digit power sum and yes/no label against a deterministic API or free browser result.

Are single-digit numbers Armstrong numbers?

Yes. For 0–9 the digit count is 1, and each digit to the first power equals itself, so is_armstrong is true.

What inputs are rejected?

Missing n, non-integers, values above the published maximum, and any negative number return invalid_input. Those failures are not charged.

Read the full KIT documentation →