Trimmed Mean Calculator
Statistics
- Inputs: the values sum to 1247.50; the 2 smallest sum to 96.20 and the 2 largest to 388.30, out of 20 values.
- Retained sum: 1247.50 - 96.20 - 388.30 = 763.00 across 16 values.
- Trimmed mean: 763.00 / 16 = 47.69.
- Trimmed mean result: 47.69 against an untrimmed mean of 62.38.
Every working statistician has met the dataset that one wild value owns: a mean dragged far from where most of the data lives by a single mis-keyed entry, a sensor glitch or a genuine but unrepresentative extreme. The trimmed mean is the classical compromise between trusting everything and trusting only the middle. Remove a fixed number of values from each tail, average what survives, and the result keeps most of the data's information while denying the extremes their leverage.
This calculator works from summary sums, the form in which trimmed means are usually reconstructed from published tables and database aggregates: the total sum, the sum of the k smallest values, the sum of the k largest, the count and k itself. It returns the trimmed mean alongside the untrimmed mean, the retained sum and the number of values that survive. The worked examples trim a small sample hard, a small sample gently and a larger sample at the same proportional rate.
Worked examples
Trimming 2 of 20 with dominant tails
(1247.5 · 96.2 · 388.3 · 20 · 2)
| Trimmed mean | 47.69 |
| Untrimmed mean (all values) | 62.38 |
| Sum of the retained values | 763.00 |
| Values retained | 16 |
Trimming 1 of 12 gently
(438.6 · 41.5 · 88.9 · 12 · 1)
| Trimmed mean | 30.82 |
| Untrimmed mean (all values) | 36.55 |
| Sum of the retained values | 308.20 |
| Values retained | 10 |
Trimming 4 of 40 at scale
(5210.4 · 512.8 · 940.6 · 40 · 4)
| Trimmed mean | 117.41 |
| Untrimmed mean (all values) | 130.26 |
| Sum of the retained values | 3757.00 |
| Values retained | 32 |
Between the mean and the median
The mean uses every value and is hostage to the largest; the median uses only the middle rank and ignores the sizes of everything else. Trimming interpolates between them with a single dial, k, the number of values cut from each end. At k of zero nothing is cut and the trimmed mean is the ordinary mean. As k grows toward half the sample, the trimmed mean approaches the median. Every practical choice lives between those poles, trading a little efficiency on clean data for a lot of protection on dirty data.
The arithmetic from summary sums is one subtraction and one division. In the first worked example 20 values sum to 1247.50. The 2 smallest sum to 96.20 and the 2 largest to 388.30; removing both tails leaves a retained sum of 763.00 across 16 values, and 763.00 / 16 is the trimmed mean of 47.69. Set against the untrimmed mean of 62.38, the trim has moved the centre by nearly a quarter - the two largest values were carrying the average almost single-handedly.
That comparison is the diagnostic the page is built around. When the trimmed and untrimmed means nearly agree, as they do in the second example - 30.82 against 36.55, a gap but not a gulf - the tails were influential but not dominant. When they diverge violently, the mean was reporting the extremes, not the data, and the trimmed figure is the one to publish.
- Trimmed mean = (total sum - low tail sum - high tail sum) / (n - 2k).
- The same k is cut from both ends; asymmetric trims bias the result.
- k = 0 reproduces the ordinary mean; maximal trimming approaches the median.
- Always report the trimmed mean next to the untrimmed one - the gap is the story.
Trimming from summary sums
Working from sums rather than the raw values is not a limitation invented for this page; it is how trimmed means surface in practice. Published studies report totals and tail sums, databases aggregate them, and meta-analyses reconstruct them. The inputs here are exactly the five numbers such a reconstruction needs, and the third worked example shows the shape at scale: 40 values summing to 5210.40, the 4 smallest summing to 512.80 and the 4 largest to 940.60, leaving 3757.00 across 32 values and a trimmed mean of 117.41 against an untrimmed 130.26.
One subtlety matters when you gather the inputs: the tail sums must be the sums of the k smallest and k largest values themselves, not the values at the cut points. Confusing the two is the commonest reconstruction error, and it is invisible in the output - the arithmetic obliges either way. The winsorized mean, which does need the cut-point values, is a different statistic and has its own page.
The second example shows the gentle end of the practice: 12 values, k of 1, tail sums of 41.50 and 88.90, a retained sum of 308.20 over 10 values and a trimmed mean of 30.82. Trimming a single value at each end is the minimal insurance policy - it costs almost nothing on clean data and removes exactly the two observations most likely to be errors.
| Example | Values | Trimmed at each end | Trimmed mean | Untrimmed mean |
|---|---|---|---|---|
| First | 20 | 2 | 47.69 | 62.38 |
| Second | 12 | 1 | 30.82 | 36.55 |
| Third | 40 | 4 | 117.41 | 130.26 |
Worked examples
Example 1: Sum of all values 1247.5; Sum of the k smallest values 96.2; Sum of the k largest values 388.3; Number of values (n) 20; Values trimmed at each end (k) 2. Trimmed mean = 47.69. Supporting values: Untrimmed mean (all values) 62.38; Sum of the retained values 763.00; Values retained 16. Inputs: the values sum to 1247.50; the 2 smallest sum to 96.20 and the 2 largest to 388.30, out of 20 values. Retained sum: 1247.50 - 96.20 - 388.30 = 763.00 across 16 values. Trimmed mean: 763.00 / 16 = 47.69. Trimmed mean result: 47.69 against an untrimmed mean of 62.38.
Example 2: Sum of all values 438.6; Sum of the k smallest values 41.5; Sum of the k largest values 88.9; Number of values (n) 12; Values trimmed at each end (k) 1. Trimmed mean = 30.82. Supporting values: Untrimmed mean (all values) 36.55; Sum of the retained values 308.20; Values retained 10. Inputs: the values sum to 438.60; the 1 smallest sum to 41.50 and the 1 largest to 88.90, out of 12 values. Retained sum: 438.60 - 41.50 - 88.90 = 308.20 across 10 values. Trimmed mean: 308.20 / 10 = 30.82. Trimmed mean result: 30.82 against an untrimmed mean of 36.55.
Example 3: Sum of all values 5210.4; Sum of the k smallest values 512.8; Sum of the k largest values 940.6; Number of values (n) 40; Values trimmed at each end (k) 4. Trimmed mean = 117.41. Supporting values: Untrimmed mean (all values) 130.26; Sum of the retained values 3757.00; Values retained 32. Inputs: the values sum to 5210.40; the 4 smallest sum to 512.80 and the 4 largest to 940.60, out of 40 values. Retained sum: 5210.40 - 512.80 - 940.60 = 3757.00 across 32 values. Trimmed mean: 3757.00 / 32 = 117.41. Trimmed mean result: 117.41 against an untrimmed mean of 130.26.
Choosing k honestly
The temptation trimming creates is to tune k until the answer pleases you, and the defence is to choose it before looking, by rule. Common practice trims a fixed proportion - a tenth or a fifth of the sample at each end - or fixes k by the known error rate of the measurement process. What is not defensible is trimming until the inconvenient values are gone and then reporting the result as if the rule had been neutral.
The proportion view connects the three worked examples: the first trims 2 of 20, the third 4 of 40 - the same tenth at each end - while the second trims 1 of 12, a lighter touch. Stating k alongside the result, as any report of a trimmed mean should, lets a reader recompute the untrimmed figure from the retained sum and judge whether the trim was a rule or a preference.
Trimmed mean against its neighbours
Against the median, the trimmed mean wins on efficiency whenever the bulk of the data is well behaved: it averages many values rather than reading one rank, so it wobbles less from sample to sample. Against the winsorized mean - which caps the extremes instead of deleting them, and is worked on the same datasets on its own page - trimming is the more aggressive surgery: winsorizing keeps the extremes in the count at their capped values, so its centre always lands between the trimmed mean and the untrimmed one.
Against the plain mean there is nothing to argue on contaminated data, and the first example is the argument: a centre of 62.38 for data whose retained bulk averages 47.69 is not a summary, it is a hostage note. The trimmed mean's only real cost is the discipline of choosing k in advance and reporting it - a cost that is really a virtue wearing a disguise.
When not to trim
Sometimes the extremes are the phenomenon. Trimming the largest claims from an insurance portfolio, the longest stays from a hospital census or the biggest trades from a market dataset deletes the very observations the analysis exists to explain. The trimmed mean answers the question 'where is the centre of the ordinary bulk?' - if your question is about totals, risks or tails, it is the wrong tool no matter how cleanly it computes.
Skewed data raises the second caution. On a genuinely right-skewed distribution - incomes, reaction times, city sizes - symmetric trimming cuts real signal from the long tail while cutting noise from the short one, and the result drifts below the centre most readers mean. A transformation, or the median, serves such data better; trimming is built for symmetric bulks with contaminated tails.
FAQs
What is a trimmed mean?
The mean after removing the k smallest and k largest values and averaging the rest. It sits between the mean and the median: more robust than the mean against extreme values, more efficient than the median on well-behaved data.
What trimmed mean does the first worked example give?
Twenty values sum to 1247.50; the 2 smallest sum to 96.20 and the 2 largest to 388.30. The retained sum is 763.00 across 16 values, giving 47.69 - far below the untrimmed mean of 62.38, because the largest values dominated the total.
Why does this calculator take sums instead of the raw data?
Because that is how trimmed means are reconstructed in practice - from published tables, database aggregates and meta-analyses that report the total sum and the two tail sums. Five numbers are all the statistic needs.
How should I choose k?
By rule, in advance: a fixed proportion of the sample at each end, such as the tenth used in the first and third examples, or a count matched to your measurement process's known error rate. Choosing k after seeing the result turns a robust statistic into a preference.
How does trimming differ from winsorizing?
Trimming deletes the extremes and reduces the count; winsorizing caps them at the cut-point values and keeps the count. On this page's first dataset the trimmed mean is 47.69, while the winsorized mean of the same data, worked on its own page, lands higher - between the trimmed mean and the untrimmed 62.38. The gap between the two is the value of keeping the extremes in the count.
When should I not use a trimmed mean?
When the extremes are the subject - large claims, long stays, extreme trades - and when the distribution is genuinely skewed rather than contaminated. Trimming answers where the centre of the ordinary bulk is; it cannot speak for the tails it removed.