ForHosting KIT · Math

Class Width Calculator for Frequency Tables

Data running from 12 to 92 have a range of 80, so 8 classes give a class width of exactly 10. Enter the smallest value, the largest value and the number of classes to get the width before you draw up your frequency table. 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
Minimum
12
Maximum
92
Class count
8
You get
Range
80
Class width
10

The class width calculator finds the size of each interval in a grouped frequency table. Enter the smallest observation, the largest observation, and the number of classes you want. The calculator subtracts the minimum from the maximum to obtain the data range, then divides that range by the class count. It returns the inputs, range, and exact class width so you can build consistent class boundaries without repeating the arithmetic by hand.

Choose inputs that describe the complete data set

Start with the true minimum and maximum observations from the data you plan to summarize. Next, choose a positive whole number of classes. The class count controls the level of detail in the table: a small count produces broad intervals and a compact summary, while a larger count reveals more local variation but may create sparse groups.

This calculator expects the maximum to be at least the minimum and the class count to be one or greater. Negative values are valid observations; they do not require special handling as long as the minimum and maximum are ordered correctly. When every observation has the same value, the range and class width are both zero.

That result accurately describes the input, although a practical frequency table may need a convention chosen for presentation. Always decide the class count before interpreting the width, because changing it changes every interval boundary.

Understand the class width calculation

The calculation has two steps. First, subtract the minimum from the maximum to get the range. Second, divide the range by the desired class count.

For example, values extending from 12 through 92 have a range of 80. With eight classes, the exact class width is 10. The returned width is not automatically rounded, because rounding is a separate design choice that depends on the measurement scale and the conventions of your course, report, or organization.

If the exact result is a repeating decimal, you may choose a convenient width that is slightly larger so all observations remain covered. After rounding, check the final upper boundary rather than assuming the selected intervals still reach the maximum. The calculator also returns the range and normalized inputs, making the arithmetic easy to audit.

It does not count observations, select a class count, or generate boundaries; it isolates the width calculation so those later decisions can be made explicitly and documented alongside the frequency table.

Turn the result into frequency table intervals

Use the calculated width as the distance between successive lower class limits or successive class boundaries. Begin at the minimum, or at a convenient value below it if your reporting convention calls for rounded limits, and add the chosen width repeatedly. Keep the intervals mutually exclusive so each observation belongs to exactly one class.

For continuous measurements, half-open intervals such as a lower boundary included and an upper boundary excluded avoid double counting values that fall exactly on a boundary. For discrete integer data, your method may instead use inclusive limits and adjusted boundaries. State that convention with the table.

If you round the exact width upward, the last interval will usually extend beyond the observed maximum; this is normal and ensures full coverage. If you round downward, the planned number of classes may fail to cover the data, so recalculate or add another class.

Prepare a grouped frequency distribution

Find a consistent interval size before assigning observations to classes and counting their frequencies.

Plan histogram bins

Use a chosen number of classes to obtain an initial bin width for a histogram or exploratory report.

Check classroom statistics work

Verify the range and division used in a hand-built frequency table without hiding the intermediate values.

What formula does the calculator use?

It uses class width = (maximum - minimum) / class count and returns the exact numeric result.

Does the calculator round the class width?

No. It returns the exact quotient so you can apply the rounding convention appropriate to your data and table.

What if the minimum equals the maximum?

The range is zero, so the exact class width is zero. You may apply a separate presentation convention when building the table.

How many classes should I choose?

The calculator does not pick the count for you. A small count gives broad intervals and a compact summary, while a larger count shows more local variation but can leave some groups sparse. Decide the count first, because it changes every boundary.

Can the minimum or maximum be negative?

Yes. Negative values are ordinary observations and need no special handling, as long as the maximum is at least the minimum. The range is still the maximum minus the minimum.

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/stat/class-width

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/stat/class-width \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"minimum":12,"maximum":92,"class_count":8}'
{
  "minimum": 12,
  "maximum": 92,
  "class_count": 8
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.class_width",
  "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.

Choose inputs that describe the complete data set

These endpoints determine the full range that the classes must cover, so leaving out an extreme value will produce intervals that cannot contain every observation.

Turn the result into frequency table intervals

The endpoint values and class count should remain attached to the result in an analysis record, allowing another reader to reproduce why the table uses its particular spacing.

Can the minimum or maximum be negative?

Yes. Both endpoints may be negative, provided they are finite numbers and maximum is not below minimum.

What happens if the class count is zero?

The request is rejected because a frequency table must have at least one class.

How much does an API calculation cost?

Each API request costs $0.002. The same deterministic calculation can run in the browser.

Read the full KIT documentation →