ForHosting KIT · Math

Factor calculator

The factors of 12 are 1, 2, 3, 4, 6 and 12, six in all. Enter any positive whole number up to one trillion and get its complete, ordered list of divisors, with no middle pair missed. Not prime factorization, not a factorial. 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
12
You get
Factors
1, 2, 3, 4, 6, 12
Quantity
6

Finding every factor of a positive integer is one of the first number-sense tasks in school mathematics: given n, list every positive integer that divides n with no remainder. Teachers mark that list for completeness and order; homework sites rank for factors of a number; scripts need a deterministic oracle instead of a handwritten factor rainbow that misses a middle pair. This factor calculator accepts one positive integer n and returns every positive factor in ascending order, including 1 and n itself. It is not a prime-factorization landing and it is not a factorial calculator: it answers the classroom query what are the factors of n.

What the factors of a number are

A factor of a positive integer n is any positive integer d such that n divided by d leaves remainder zero. In classroom language, factors come in pairs: if three divides twelve, then four is the complementary factor because three times four equals twelve. Every positive integer has at least the pair one and itself.

A prime number has exactly those two factors. A composite number such as twelve has the longer ordered list one, two, three, four, six, and twelve. A perfect square such as thirty-six has a middle factor that pairs with itself, six times six, and that middle value appears once in the list rather than twice.

Students are taught to walk candidate values from one up through the square root, recording each pair, then write the unique factors in ascending order. That factor-rainbow or factor-pair method is exactly what this capability automates. The result is the complete set of positive factors, not the prime factorization two-squared times three, and not the factorial n!.

Those are different search intents with different landings. If you need the ordered list that a grade-school worksheet asks for when it says list all the factors of n, this is the contract: one integer in, the sorted factors out, every time, with one included and n included, and with no omitted middle pair.

How the full factor list is found

The engine walks candidate divisors from one through the integer square root of n. Whenever a candidate d divides n evenly it records d and, when the complementary quotient n divided by d is different from d, records that quotient as well, so a perfect-square middle factor is stored once. After the scan, the collected values are sorted in strictly ascending order.

Example: n equals twelve yields factors one, two, three, four, six, twelve and count six. Example: n equals one yields the singleton list containing only one. Example: n equals seven, a prime, yields one and seven.

Where a factor list earns its keep

Classrooms use a factor calculator so learners can check a factor rainbow against a canonical ordered list instead of waiting for a teacher to catch a missing pair. Exam generators and learning-management plugins need a deterministic oracle that rejects non-integers instead of silently coercing twelve-point-five into twelve. Product configuration tools sometimes need every factor of a batch size or page count so a user interface can offer legal split points.

Failed validation does not consume balance. Sibling pages cover prime factorization, which breaks n into primes and exponents, the number-theory divisor list with count and sum, proper divisors excluding n, and n factorial; this landing is the school-math query factors of a number and the short slug factor. Pin the ordered array in tests, keep n within limits, and you get reproducible factors for homework, gradebooks, and edge workers without standing up a computer-algebra system of your own.

Classroom factor rainbows

Check a student’s ordered list of factors for a given n against one canonical response instead of grading a handwritten factor-pair walk.

How do I find all factors of a number with this tool?

The response includes factors in ascending order and count.

Is this the same as prime factorization or n factorial?

No. This lists every positive factor of n, including 1 and n. Prime factorization breaks n into primes; n! is a product, not a factor list.

What happens if I send 0, a decimal, or a negative number?

Only positive integers starting at 1 are accepted; failed validation is not billed.

Does the factor list include 1 and the number itself?

Yes. Every positive integer has 1 and n as factors.

Why does 36 list the factor 6 only once?

Because 6 pairs with itself, since 6 times 6 is 36. Every other factor of 36 has a different partner, but the middle value of a perfect square is written once, not twice.

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/math/factor

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/math/factor \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n":12}'
{
  "n": 12
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.factor",
  "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.

min_n1
max_n1000000000000
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.

Zero, negatives, and non-integers fail with invalid_input and are not billed.

Input contract, algorithm, and response shape

Send a JSON body with the required field n, a positive integer from one through one trillion. The aliases number and value are accepted as transport names for the same field. Missing n, an empty string, a boolean, an object, a decimal, zero, a negative value, or a number above the published ceiling fails with invalid_input naming what went wrong, and those failures are not billed. The response echoes n, returns factors as that ordered array, and returns count as the length of the array so clients do not re-derive it. There is no randomness, no clock, and no network: two identical requests always produce the same JSON.

Exam and LMS auto-grading

Mark factors-of-a-number items with a deterministic oracle that rejects zero, negatives, and decimals as invalid_input rather than a silent wrong list.

Split points and contest fixtures

Obtain every factor of a batch size, page count, or contest integer so scripts can offer legal splits or assert complete factor tables.

What does the factor calculator cost?

The browser widget is free and runs locally. API calls use prepaid KIT balance at the published $0.002 base price; invalid input is not charged.

Read the full KIT documentation →