One more solution, which works for both numeric & character/factor data:

Mode <- function(x) {
  ux <- unique(x)
  ux[which.max(tabulate(match(x, ux)))]
}

On my dinky little machine, that can generate & find the mode of a 10M-integer vector in about half a second.

If your data set might have multiple modes, the above solution takes the same approach as which.max, and returns the first-appearing value of the set of modes. To return all modes, use this variant (from @digEmAll in the comments):

Modes <- function(x) {
  ux <- unique(x)
  tab <- tabulate(match(x, ux))
  ux[tab == max(tab)]
}
Answer from Ken Williams on Stack Overflow
🌐
CalculatorSoup
calculatorsoup.com › calculators › statistics › mean-median-mode.php
Mean, Median, Mode Calculator
Count how many times each number occurs in the data set. The mode is the number with the highest tally. It's ok if there is more than one mode. And if all numbers occur the same number of times there is no mode.
🌐
Scribbr
scribbr.com › home › how to find the mode | definition, examples & calculator
How to Find the Mode | Definition, Examples & Calculator
June 21, 2023 - ... If the data for your variable takes the form of numerical values, order the values from low to high. If it takes the form of categories or groupings, sort the values by group, in any order.
People also ask

How do I find the mode?
To find the mode: · If your data is numerical or quantitative, order the values from low to high. · If it is categorical, sort the values by group, in any order. · Then you simply need to identify the most frequently occurring value.
🌐
scribbr.com
scribbr.com › home › how to find the mode | definition, examples & calculator
How to Find the Mode | Definition, Examples & Calculator
Can there be more than one mode?
A data set can often have no mode, one mode or more than one mode – it all depends on how many different values repeat most frequently. · Your data can be: · without any mode · unimodal, with one mode, · bimodal, with two modes, · trimodal, with three modes, or · multimodal, with four or more modes.
🌐
scribbr.com
scribbr.com › home › how to find the mode | definition, examples & calculator
How to Find the Mode | Definition, Examples & Calculator
Which measures of central tendency can I use?
The measures of central tendency you can use depends on the level of measurement of your data. · For a nominal level, you can only use the mode to find the most frequent value. · For an ordinal level or ranked data, you can also use themedian to find the value in the middle of your data set. · For intervalor ratiolevels, in addition to the mode and median, you can use the mean to find the average value.
🌐
scribbr.com
scribbr.com › home › how to find the mode | definition, examples & calculator
How to Find the Mode | Definition, Examples & Calculator
🌐
Statistics By Jim
statisticsbyjim.com › home › blog › how to find the mode
How to Find the Mode - Statistics By Jim
June 23, 2025 - For larger datasets, you can find the mode using a frequency table. Learn about frequency tables and how to make them with Excel. For example, the frequency table below contains 126 observations.
🌐
Investopedia
investopedia.com › terms › m › mode.asp
Mode: What It Is in Statistics and How to Calculate It
July 14, 2025 - To find the mode, simply count how many times each value appears in the dataset. ... In statistics, the mode is the number that occurs most often in a set of data.
🌐
Reddit
reddit.com › r/askmath › how do you find the 'mode' of samples from a continuous data set?
r/askmath on Reddit: How do you find the 'mode' of samples from a continuous data set?
July 15, 2025 -

I am looking for the 'mode' from a source where I am not expecting exactly duplicate values. My approach is to treat each sample as a normal distribution with a mean of the sample value and a constant standard deviation. Then take the sum of the PDF's of those distributions as my new PDF, divided by the number of samples. The mode should be the maxima of this function. However, I am finding it difficult to find this maxima, given that the derivative of the pdf of the sum of a number of standard distributions is not easily solvable. Is there a way to solve this analytically, or am I going to have to come up with a numerical solution? Using Newton-Raphson seems like it will have problems, as it tends to just find the nearest zero to your initial guess, and this derivative is going to have a lot of zeroes...

🌐
Virtual Nerd
virtualnerd.com › sat-math › arithmetic › averages › mode-data-set
How Do You Find the Mode of a Data Set? | Virtual Nerd
The mode of a data set is the number that occurs most frequently in the set. To easily find the mode, put the numbers in order from least to greatest and count how many times each number occurs. The number that occurs the most is the mode!
Find elsewhere
🌐
Wikipedia
en.wikipedia.org › wiki › Mode_(statistics)
Mode (statistics) - Wikipedia
January 26, 2005 - If X is a discrete random variable, the mode is the value x at which the probability mass function P(X) takes its maximum value, i.e., x = argmaxxi P(X = xi). In other words, it is the value that is most likely to be sampled.
🌐
Math is Fun
mathsisfun.com › mode.html
How to Calculate the Mode or Modal Value
We can now easily see which numbers appear most often. In this case the mode is 23. Arrange them in order: [8, 15, 19, 19, 28, 29, 35] 19 appears twice, all the rest appear only once, so 19 is the mode. ... We can have more than one mode.
🌐
Indeed
indeed.com › career guide › career development › how to calculate mode in statistics (with examples)
How To Calculate Mode in Statistics (With Examples) | Indeed.com
September 4, 2024 - You can find it easily by counting how many times each number occurs within the data set. Example: In the data set [5, 7, 8, 2, 1, 5, 6, 7, 5], the mode is 5, as it occurs most often.
🌐
Statistics Canada
www150.statcan.gc.ca › n1 › edu › power-pouvoir › ch11 › mode › 5214873-eng.htm
4.4.3 Calculating the mode
During a hockey tournament, Audrey scored 7, 5, 0, 7, 8, 5, 5, 4, 1 and 5 points in 10 games. After summarizing the data in a frequency table, you can easily see that the mode is 5 because this value appears the most often in the data set (4 times). The mode can be considered a measure of central ...
🌐
Virtual Nerd
virtualnerd.com › sat-math › arithmetic › averages › multiple-mode-data-set
How Do You Find the Mode of a Data Set When There is More Than One Mode? | Virtual Nerd
To easily find the mode, put the numbers in order from least to greatest and count how many times each number occurs. The number that occurs the most is the mode! Follow along with this tutorial and see how to find the mode of a set of data.
🌐
Wikihow
wikihow.com › education and communications › studying › mathematics › probability and statistics › how to find the mode of a set of numbers: quick & easy steps
How to Find the Mode of a Set of Numbers: Quick & Easy Steps
February 16, 2025 - In this section, let's use this set of values for the purposes of our example: {18, 21, 11, 21, 15, 19, 17, 21, 17}. In the next few steps, we'll find the mode of this set. ... Order the numbers from smallest to largest. Next, it's often a wise ...
🌐
Study.com
study.com › skill › learn › how-to-find-the-mode-of-a-data-set-explanation.html
How to Find the Mode of a Data Set | Math | Study.com
Sam recorded how long it took him to run a mile on 4 different days. What is the mode of his mile times? Step 1: Order the values in the data set from least to greatest.
🌐
Microsoft Support
support.microsoft.com › en-us › office › mode-function-e45192ce-9122-4980-82ed-4bdc34973120
MODE function - Microsoft Support
Let's say you want to find out ... calls at a telephone support center during off-peak hours. To calculate the mode of a group of numbers, use the MODE function. The MODEfunction returns the most frequently occurring, or repetitive, value in an array or range of ...
🌐
YouTube
youtube.com › helpyourmath - statistics
Finding the Mode of a Data Set - No Mode, One Mode, Two Modes (Bimodal) or More than Two Modes - YouTube
AboutPressCopyrightContact usCreatorsAdvertiseDevelopersTermsPrivacyPolicy & SafetyHow YouTube worksTest new features · © 2024 Google LLC
Published   June 29, 2021
Views   42K
🌐
BYJUS
byjus.com › maths › mode
When there are two modes in a data set, then the set is called
October 14, 2021 - We can also say that the value or number in a data set, which has a high frequency or appears more frequently, is called mode or modal value. It is one of the three measures of central tendency, apart from mean and median.
🌐
Nagwa
nagwa.com › en › explainers › 847129534561
Lesson Explainer: The Mode of a Data Set | Nagwa
In this set of data, the data values are the temperatures. The mode is the most common temperature. To find the mode, we need to count how many times each data value appears.