Divisibility test
Is 252 divisible by 7? Yes: it fits 36 times with a remainder of 0. Enter any two whole numbers, negatives included, and get a clear yes or no together with the quotient and remainder that prove it. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Dividend
- 252
- Divisor
- 7
- Quotient
- 36
- Remainder
- 0
You send a dividend and a divisor, and you get back a plain true or false, together with the quotient and the remainder that justify the answer. It handles negative integers and digit strings, rejects a zero divisor with a clear error, and never rounds or approximates — the arithmetic is exact integer math, so the answer is the same everywhere you run it.
What the divisibility test answers
An integer a is divisible by an integer b when the division a ÷ b leaves no remainder. That sounds trivial, and for small numbers it is — most people know the shortcuts for 2, 3, 5 and 10. But the question stops being trivial when the numbers are large, negative, or arrive as strings from a form field or a spreadsheet column.
Zero is handled carefully: any integer divides zero, and zero itself is rejected as a divisor with a clear error rather than a silent wrong answer.
How the check is computed
The computation is exact integer arithmetic, not floating-point division. Once validated, the remainder is computed directly: when it is zero the dividend is divisible, and the quotient follows as (dividend − remainder) ÷ divisor, which is always an exact integer with no rounding involved. Negative values behave as mathematics expects: −252 is divisible by 7, and the result reflects that, with the remainder carrying the sign convention of the dividend.
Both inputs are bounded to the safe-integer range, so every comparison is exact on any machine, in the browser and on the server alike, and anything beyond that range is refused instead of silently approximated.
Where it fits in real work
Divisibility checks hide inside a surprising amount of everyday software: pagination code that needs to know whether a total splits evenly into pages, schedulers that fire every nth day, invoice systems that verify a batch total can be split among cost centers, and validation rules that require a serial number to be a multiple of a checksum base.
Doing this as a service call means the rule lives in one place with one definition of an integer and one behavior for edge cases, instead of being re-implemented — and occasionally mis-implemented — in every pipeline that needs it. The response also carries the quotient and remainder, which is usually the very next thing the calling code would compute anyway.
What you can do with it
Validate even splits in batch processing
Confirm a record count divides evenly into the number of workers before launching a parallel job, and read the quotient to size each shard.
Check scheduling intervals
Test whether a day-of-year or timestamp offset is an exact multiple of your recurrence interval before firing a scheduled task.
Verify checksums and serial formats
Confirm an identifier is divisible by its checksum base as a fast integrity check on incoming data.
FAQ
Are negative integers supported?
Yes. Divisibility is defined over all integers, so −252 is divisible by 7 and the tool reports it as such.
Can I pass the numbers as strings?
Yes. Digit strings like "252" are parsed as integers. Anything that does not parse to an exact integer — decimals, booleans, text — is rejected.
Is the result exact for very large numbers?
Inputs up to the maximum safe integer are computed exactly. Values beyond that range are rejected rather than approximated.
Is zero divisible by every number?
Yes. Any whole number divides zero, so testing 0 always gives yes. The opposite does not work: zero cannot be the divisor, and the test refuses it with a clear message instead of a wrong answer.
Why does the test also give the quotient and remainder?
Because the yes or no is often only half the answer. The quotient tells you how many times the divisor fits, and the remainder how far you are from an even split; 252 by 7 gives 36 and 0.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/divisibility-test \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"dividend":252,"divisor":7}'const res = await fetch("https://api.kit.forhosting.com/math/divisibility-test", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"dividend": 252,
"divisor": 7
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/divisibility-test",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"dividend": 252,
"divisor": 7
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/divisibility-test", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"dividend":252,"divisor":7}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"dividend":252,"divisor":7}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/divisibility-test", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"dividend": 252,
"divisor": 7
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.divisibility_test",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The divisibility test API answers one of the oldest questions in arithmetic: does this number divide that one exactly?
What the divisibility test answers
The divisibility test calculator does the check in one call: send the dividend and the divisor and read the boolean answer. It also returns the quotient and the remainder, because in most real workflows the yes or no is only half of what you need — the other half is knowing how many times the divisor fits, or how far off an even split you are.
How the check is computed
Both inputs are first validated as integers — a JSON integer or a digit string that parses to one — and rejected with an explicit error when they are not, because a floating-point modulo of two inexact values can report a remainder of zero for numbers that are not actually divisible.
Where it fits in real work
The same code that runs here runs free in your browser on this page, so you can verify a pair of numbers by hand and only pay $0.002 per request when you automate the check.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free to run in your browser on this page.
What happens if the divisor is zero?
The request is rejected with an invalid_input error: division by zero is undefined, so there is no meaningful true or false to return.
What exactly is returned?
A boolean telling whether the dividend is divisible by the divisor, plus the quotient and the remainder, so you get the justification along with the answer.