Most frequent value calculator
In red, blue, red, green, red, blue the most frequent value is red, which appears 3 times; blue follows with 2 and green with 1. Paste any list of labels or codes to get the winner and the full count table. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Values
- red, blue, red, green, red, blue
- Total
- 6
- Unique
- 3
- Max frequency
- 3
- Most frequent values
- red
When you hold a list of categories, codes, grades, product names, or other discrete labels, the first question is often simple: which value shows up most often, and how many times? This most frequent value calculator answers that question for any non-empty list. It counts exact matches, reports every value tied at the highest frequency, and returns a full frequency table sorted by count.
What most frequent value means on a discrete list
The most frequent value is the statistical mode applied to a list of discrete labels rather than to a continuous numeric sample. Each entry is treated as a category token: after trimming surrounding whitespace, two tokens match only when their string forms are identical, so red and Red are different if you pass both casings, and product codes keep leading zeros when you send them as text. The calculator walks the list once, tallies how many times each distinct value appears, and finds the maximum tally.
Every value that reaches that maximum is a most frequent value. A list where every value appears exactly once still has a well-defined answer: every unique token is a most frequent value with frequency one, which is honest for pure categorical data and different from some numeric mean-median-mode tools that leave modes empty when all frequencies equal one.
The accompanying frequencies table lists every distinct value with its count and its share of the total, ordered by count descending and by value ascending on ties, so you can read not only the winner but the full ranking. Classic classroom example: red, blue, red, green, red, blue yields most frequent value red with count three, unique three, and a table that also shows blue twice and green once. Single-element lists return that one value with frequency one.
Always reject an empty list rather than inventing a mode from no observations.
Practical tips, limits, and how this differs from related tools
Prefer sending the raw list once and reading both the mode array and the full frequency table from one response instead of calling separate counters. If your source text is free prose rather than a pre-tokenized list of values, a word frequency or most common word tool that splits sentences is a better fit; this page is specifically for people searching for a most frequent value calculator on an explicit list of discrete items.
If you need mean, median and range together with a numeric mode, use a mean median mode calculator on a finite number sample; this capability stays focused on frequency of values and does not compute averages or order statistics. Normalize casing and spelling in your own pipeline before calling the tool if you want case-insensitive categories; the engine preserves exact tokens so that product codes and identifiers are never silently merged.
What you can do with it
Survey and poll answer ranking
Paste categorical responses from a form and see which option won, whether the top is tied, and the full frequency table for reporting.
Inventory and SKU popularity
Feed a list of product codes or warehouse bins and identify the most frequent SKU plus how many times each top code appears.
Classroom mode homework on labels
Check student answers for the mode of a list of colors, grades or names without computing mean or median on non-numeric data.
FAQ
What if the list is empty?
There is no most frequent value of nothing; failed validation is not charged.
Are values case-sensitive?
Yes. Matching is exact after trim. red and Red count as different tokens. Normalize casing yourself if you need case-insensitive categories.
Is the most frequent value calculator free?
The browser tool is free and runs locally.
What if two values tie for first place?
All tied values are returned in a stable alphabetical order, together with a note that there is a tie, so you never have to guess which winner came first in the list.
What if every value appears only once?
Then every value is equally frequent with a count of one, and the calculator returns all of them as most frequent. That is the honest answer for categories, even though some numeric tools leave the mode empty.
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/stat/most-frequent-value \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"values":["red","blue","red","green","red","blue"]}'const res = await fetch("https://api.kit.forhosting.com/stat/most-frequent-value", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"values": [
"red",
"blue",
"red",
"green",
"red",
"blue"
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/most-frequent-value",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"values": [
"red",
"blue",
"red",
"green",
"red",
"blue"
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/most-frequent-value", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"values":["red","blue","red","green","red","blue"]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"values":["red","blue","red","green","red","blue"]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/most-frequent-value", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"values": [
"red",
"blue",
"red",
"green",
"red",
"blue"
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.most_frequent_value",
"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
Empty lists fail with invalid_input and are never charged.
What most frequent value means on a discrete list
When a single label clearly dominates, the result is unimodal and most_frequent_values holds one entry. When two or more labels share the same highest count, the result is a tie: is_tie is true and the array lists every co-mode in stable lexicographic order so clients never have to guess which winner came first.
How to call the API and what comes back
A single comma, semicolon, newline or whitespace separated string is also accepted for plain text forms, which makes pasting a column from a spreadsheet practical. Share is count divided by total rounded to six decimal places for stable goldens across runtimes. Use it from survey dashboards, SKU popularity checks, categorical homework checkers, log tag ranking, and any workflow that needs the mode of a label list without installing a statistics package. Send a JSON body with one required field named values: a non-empty array of scalar tokens. Aliases data, list and items are accepted and behave the same. Each element may be a non-empty string, a finite number, a boolean, or a bigint; numbers and booleans are converted to their stable string form before counting so that the JSON contract stays simple for web forms and SDK clients. On success the response includes total as the length of the list, unique as the number of distinct tokens, max_frequency as the highest count observed, most_frequent_values as the sorted array of every token that reaches that count, most_frequent_count as the length of that array, is_tie true when more than one token shares the top, frequencies as the ordered table of value, count and share for every distinct token, and method set to most_frequent_value. Failed validation—missing values, an empty list, empty string elements, nested objects or arrays as elements, non-finite numbers, or a list longer than one hundred thousand entries—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item.
Practical tips, limits, and how this differs from related tools
Keep lists within the published size cap so interactive Worker and browser paths stay fast; one hundred thousand tokens is ample for classroom sets, survey batches and most operational samples. When teaching multimodal data, pair a clear unimodal list such as a a b with a tie such as a a b b to show is_tie and a sorted most_frequent_values array with two entries. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap while users paste empty cells by mistake.
Technical questions
What does this most frequent value calculator return?
It returns total, unique, max_frequency, the sorted most_frequent_values array, most_frequent_count, is_tie, a frequencies table with value, count and share for every distinct token, and method.
What happens if two values appear equally often at the top?
Both are returned in most_frequent_values in lexicographic order, is_tie is true, and max_frequency is that shared count. No single winner is invented.