Calculate class attendance percentage and check a policy threshold
Attending 31 of 40 classes is 77.5 percent, which falls below an 80 percent rule. Enter the classes held, the classes attended and the required minimum to get the percentage and a clear below-or-not answer. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Classes held
- 40
- Classes attended
- 31
- Policy threshold
- 80
- Attendance percentage
- 77.5
This class attendance percentage calculator turns two simple counts into a clear policy check. Enter how many classes were held, how many were attended, and the minimum percentage required by your school, course, or program. The result shows the attendance percentage and a direct flag indicating whether it is below that threshold. The calculator also rejects impossible records in which attended classes exceed held classes, helping students, teachers, and administrators catch a common data-entry mistake before relying on the result.
Calculate attendance from the underlying class counts
Attendance percentage begins with two counts from the same period: classes held and classes attended. The calculator divides attended classes by held classes, then multiplies the ratio by 100. For example, attending 31 of 40 classes produces 77.5 percent.
Use scheduled sessions that actually took place as the held count; cancelled lessons normally should not be included because nobody could attend them. The attended count should represent sessions credited as present under the institution's own rules. If late arrivals, excused absences, laboratory sessions, or partial attendance receive special treatment, resolve those records before entering the totals.
This capability deliberately does not invent institutional rules or turn partial credits into whole classes. It calculates the result from the supplied whole-number counts. At least one class must have been held because a percentage with a zero denominator is undefined.
Zero attended classes is valid and returns zero percent. The displayed percentage is rounded to two decimal places, providing a readable result while preserving the familiar calculation students can independently verify.
Compare the result with the correct policy threshold
The policy threshold is the minimum acceptable attendance percentage, expressed from 0 to 100. Enter 75 when a course requires at least 75 percent attendance, or 90 when a program requires 90 percent. Equality therefore passes: an exact 75 percent is not below a 75 percent rule.
Importantly, the comparison uses the full mathematical ratio rather than the percentage rounded for display. That distinction prevents a value such as 74.996 percent from appearing as 75.00 and incorrectly passing a 75 percent requirement. Policies sometimes describe eligibility with different language, grace periods, approved absences, or a required number of sessions rather than a raw percentage.
Translate those rules into the appropriate held and attended counts before using this check, and consult the authoritative course policy when consequences matter. The flag answers one narrow question consistently; it does not decide disciplinary action, examination eligibility, or whether an absence should be excused.
Validate records and use the result responsibly
A trustworthy percentage depends on internally consistent records. Classes attended cannot exceed classes held, so the capability returns an invalid-input error when that impossible relationship appears. Both counts must be whole numbers: class totals such as 18.5 are rejected instead of silently rounded.
The threshold may include decimals, which supports policies such as 82.5 percent. Before calculating, make sure both counts cover the same student, subject, and reporting window. Mixing a semester-long attendance count with a monthly held count can produce a plausible but meaningless percentage.
Keeping those inputs with the result makes later review much easier if a register changes. No network lookup, random value, current date, or school-specific database affects the calculation; all meaning comes from the three values you provide.
What you can do with it
Student progress check
Calculate current attendance before the end of a term and see whether it is below the course requirement.
Teacher register review
Verify a student's percentage from register totals and catch an impossible attended count before publishing a report.
Education portal automation
Apply one stated threshold consistently to attendance totals and store a simple policy flag with each result.
FAQ
How is class attendance percentage calculated?
Classes attended are divided by classes held, and the result is multiplied by 100. The displayed percentage is rounded to two decimal places.
Why can classes attended not exceed classes held?
That relationship is impossible for one consistent reporting period.
Can the policy threshold contain a decimal?
Yes. Any finite threshold from 0 through 100 is accepted, including values such as 82.5.
Does rounding affect the policy flag?
No. The output percentage is rounded for readability, but the below-threshold comparison uses the unrounded mathematical percentage.
Does exactly 75 percent pass a 75 percent attendance rule?
Yes. Only attendance strictly below the minimum is flagged, so an exact match passes. If your course requires 75 percent, a record that lands exactly on that figure shows as meeting the rule.
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/edu/attendance-percentage \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"classes_held":40,"classes_attended":31,"policy_threshold":75}'const res = await fetch("https://api.kit.forhosting.com/edu/attendance-percentage", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"classes_held": 40,
"classes_attended": 31,
"policy_threshold": 75
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/edu/attendance-percentage",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"classes_held": 40,
"classes_attended": 31,
"policy_threshold": 75
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/edu/attendance-percentage", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"classes_held":40,"classes_attended":31,"policy_threshold":75}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"classes_held":40,"classes_attended":31,"policy_threshold":75}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/edu/attendance-percentage", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"classes_held": 40,
"classes_attended": 31,
"policy_threshold": 75
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "edu.attendance_percentage",
"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
Compare the result with the correct policy threshold
The result includes below_policy_threshold, which is true only when the calculated attendance is strictly less than the supplied threshold.
Validate records and use the result responsibly
For repeated checks, an application can call the API at $0.002 per item and store the returned counts, percentage, threshold, and policy flag alongside the reporting period. The browser calculator uses the same deterministic logic as the API, so equivalent inputs produce equivalent outputs.
Technical questions
What happens when attendance equals the threshold?
Equality is not below the threshold, so below_policy_threshold is false. Only a strictly lower percentage is flagged.