ForHosting KIT · Math

Grouped data mode calculator

Estimate the most common value when data come grouped in classes: with boundaries 0, 10, 20, 30 and 40 and counts 5, 9, 12 and 7, the mode is 23.75, inside the 20–30 class. Every step of the working is shown. 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
Class boundaries
0, 10, 20, 30, 40
Frequencies
5, 9, 12, 7
You get
Calculation mode
23.75
Modal class index
2
Class width
10
Modal frequency
12

The grouped data mode calculator estimates the most common value when observations are summarized into class intervals instead of listed individually. Supply the ordered class boundaries and the frequency for every interval. The calculator identifies the single modal class, compares its frequency with the classes immediately before and after it, and interpolates a modal value inside that interval. It also returns the chosen class, its width, neighboring frequencies, and the interpolation fraction so the result is easy to inspect, explain, and reproduce.

Enter boundaries and frequencies in matching order

Grouped observations are represented by intervals and counts. Four intervals therefore require five boundaries. For example, boundaries 0, 10, 20, 30, and 40 describe the classes 0–10, 10–20, 20–30, and 30–40.

Frequencies 5, 9, 12, and 7 attach a count to those same classes in that order. Boundaries must be finite numbers and strictly increase; frequencies must be finite and non-negative. The calculator deliberately requires explicit frequencies because class intervals alone say nothing about where observations are concentrated.

It also requires exactly one more boundary than frequency, preventing a count from being silently attached to the wrong class. Use true class boundaries rather than class labels or midpoints. If a table lists inclusive integer limits such as 10–19 and 20–29, first convert those limits to the continuous boundaries appropriate for the measurement convention, such as 9.5–19.5 and 19.5–29.5.

This keeps the class width and interpolated position meaningful.

Understand the interpolation formula

The modal class is the interval with the greatest frequency. The estimated grouped mode is L + (d1 / (d1 + d2)) × h. Here, L is the lower boundary of the modal class, h is its width, d1 is the modal frequency minus the preceding frequency, and d2 is the modal frequency minus the following frequency.

The fraction places the estimate between the lower and upper boundaries. When the rise from the preceding class is stronger than the fall toward the following class, the result moves farther into the modal interval; when the fall is stronger, it stays closer to the lower edge. The response exposes the modal class index, both boundaries, all three relevant frequencies, class width, and interpolation fraction alongside the final mode.

Those intermediate values make it possible to audit the calculation or show the working in a report. The method estimates a peak from grouped counts; it does not recover an exact observed mode that was lost during grouping.

Interpret the estimate and recognize its limits

Use the returned mode as an estimate of the distribution’s local peak, not as proof that any original observation had exactly that value. Grouping replaces individual values with interval counts, so the answer depends on the chosen boundaries and on the assumption that neighboring frequency changes can locate a peak within the modal class. Wider intervals generally produce a coarser estimate, while different bin choices can move the modal class.

The calculator rejects a tie for the highest frequency because two or more modal classes do not define one unambiguous interpolation neighborhood. If your table has tied peaks, report it as multimodal or revise the analytical method instead of accepting an arbitrary first class. It also rejects all-zero frequencies, descending or repeated boundaries, negative counts, non-finite numbers, and mismatched array lengths.

Frequencies may be fractional weights as well as whole-number counts, provided they are non-negative. For transparent reporting, retain the returned modal class and interpolation fraction with the final value.

Summarize a grouped survey

Estimate the most common response value when results are published as score bands with respondent counts.

Analyze production measurements

Locate the approximate peak of a measurement distribution after readings have been aggregated into fixed intervals.

Check classroom calculations

Reproduce the grouped-mode formula and inspect every intermediate frequency used in the interpolation.

What formula does the calculator use?

It uses L + (d1 / (d1 + d2)) × h, where L and h describe the modal class and d1 and d2 are frequency differences on either side.

Why must I provide one more boundary than frequency?

Each frequency belongs to the interval between two consecutive boundaries, so n intervals require n + 1 edges.

Can the highest frequency be tied?

No. A tie has no unique modal class, so the calculator asks you to report multimodality or choose another method rather than selecting arbitrarily.

Does the result have to be an observed value?

No. It is an estimate inside the modal interval, and the original values are unavailable once the data has been grouped.

How do I enter classes written as 10–19 and 20–29?

Turn those whole-number limits into continuous boundaries first, following how the data were measured, for example 9.5–19.5 and 19.5–29.5. That keeps the class width and the interpolated position meaningful.

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/grouped-mode

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/grouped-mode \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"class_boundaries":[0,10,20,30,40],"frequencies":[5,9,12,7]}'
{
  "class_boundaries": [
    0,
    10,
    20,
    30,
    40
  ],
  "frequencies": [
    5,
    9,
    12,
    7
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.grouped_mode",
  "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.

Enter boundaries and frequencies in matching order

Enter every class edge in class_boundaries, from the lowest edge to the highest, and enter one count per interval in frequencies.

Understand the interpolation formula

For a modal class at the beginning or end of the table, the absent neighboring frequency is treated as zero, a common endpoint convention that still provides a deterministic estimate.

Interpret the estimate and recognize its limits

The browser calculator and API use the same deterministic arithmetic. Interactive use is free on the page, while an automated API request costs $0.002; no network lookup, random choice, or time-dependent input affects the result.

What happens when frequencies are missing?

The request returns an invalid_input error because boundaries alone cannot identify a modal class or support interpolation.

How much does an API calculation cost?

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

Read the full KIT documentation →