ForHosting KIT · Math

Common factor calculator

See every whole number that divides all your integers exactly: 12, 18 and 30 share the factors 1, 2, 3 and 6, and their greatest common divisor is 6. Handy for simplifying fractions or splitting items into equal groups. 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
Numbers
12, 18, 30
You get
Gcd
6
Common factors
1, 2, 3, 6
Quantity
4

A common factor of two or more integers is a whole number that divides every one of them exactly. Given a list of at least two integers, this capability returns the sorted list of positive factors they all share, together with the greatest common divisor and the normalized inputs. The computation is pure integer arithmetic: a Euclidean gcd reduction followed by divisor enumeration, with no network calls, no randomness, and no model inference. Use it to simplify fractions, check homework, plan equal groupings, or feed a pipeline that needs a machine-readable list of shared divisors.

What common factors are and how the result is built

A factor of an integer is a whole number that divides it without remainder, and a common factor of several integers is one that divides all of them. The key mathematical shortcut is that the common factors of any set of integers are exactly the factors of their greatest common divisor, so there is no need to factor every input separately.

This capability first reduces the absolute values of the inputs with the Euclidean algorithm to obtain the gcd, then enumerates the divisors of that gcd in pairs up to its square root and sorts the result ascending. For example, 12, 18 and 30 have gcd 6 and therefore share exactly [1, 2, 3, 6].

Practical uses in education, engineering, and automation

Teachers and students use common factors to simplify fractions, find shared denominators, and verify hand work against a machine oracle before submitting assignments. Word problems about splitting items into equal groups—classrooms into teams, stock into batches, lengths of material into identical offcuts—reduce directly to listing the common factors of the quantities involved, and the count field tells you immediately how many valid group sizes exist.

For related needs, pair it with a divisor-list capability for a single integer or a gcd/lcm tool when you only need the aggregate values rather than the full sorted factor list.

Simplifying fractions and ratios

List the common factors of a numerator and denominator to find every valid simplification step, then divide by the gcd for the lowest terms.

Equal grouping and batching

Find every team size that divides several group counts evenly—class sizes, inventory lots, or cable lengths—using the sorted shared factor list.

Homework and grading checks

Students compare their hand-computed common factors with the returned list, and judges assert exact array equality without floating-point noise.

What is a common factor?

A whole number that divides two or more integers exactly. For 12, 18 and 30 the common factors are 1, 2, 3 and 6, returned here as a sorted ascending list.

How are common factors related to the gcd?

The common factors of any set of integers are exactly the divisors of their greatest common divisor. This tool computes the gcd first, then enumerates its divisors, and returns both.

Does the order or sign of the inputs matter?

No. Divisibility ignores sign and order: -48, 180 and 0 share the same factors as 48 and 180. The output list is always sorted ascending.

How do common factors help split items into equal groups?

Every common factor is a group size that divides all the quantities evenly. For 12, 18 and 30 items, groups of 1, 2, 3 or 6 work, and the count of 4 tells you how many valid sizes there are.

Can one of the numbers be zero?

Yes, as long as at least one other number is not zero. Zero is divisible by every whole number, so the common factors of zero and another number are simply the factors of that number.

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

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.

API pricing is a flat $0.002 per successful request; invalid inputs are rejected without charge.

What common factors are and how the result is built

The response contains four fields: numbers echoes the normalized integer list, gcd is the greatest common divisor, common_factors is the sorted array of shared positive factors, and count is its length. Because every step is deterministic integer arithmetic, the same input always produces the same output byte for byte, which makes the result safe to cache, to snapshot in tests, and to compare across the free browser tool and the paid API.

Accepted inputs, edge cases, and errors

Negative integers are fine—their sign is irrelevant to divisibility—and a zero is allowed as long as at least one other value is non-zero, because the common factors of zero and n are simply the factors of n. There are no optional flags: the output always includes the gcd and the full sorted factor list. Send a JSON object with a required field numbers holding an array of at least two integers. Each item may be a JSON integer or a digit-only string that parses to the same whole value, so form submissions work without client-side conversion; the aliases values, integers, and list are also accepted. Inputs are rejected with an invalid_input error when the array is missing or shorter than two items, when any item is a boolean, object, fraction, NaN, or Infinity, when any magnitude exceeds the JavaScript maximum safe integer, or when every value is zero (every integer divides zero, so the shared set would be unbounded). Failed validation never consumes prepaid balance; only successful computations bill the published base of $0.002 per item.

Practical uses in education, engineering, and automation

The browser tool and the API import the same pure function, so you can prototype interactively for free and promote the identical contract to production workers later.

What inputs does this calculator accept?

An array of at least two integers, given as JSON numbers or digit strings. Negative values and a single zero are allowed; non-integers, arrays shorter than two, and all-zero input yield invalid_input.

How much does the API cost?

Successful requests cost the published base price of $0.002 per item. Invalid input errors are not charged, and the in-browser tool remains free for interactive use.

Read the full KIT documentation →