Trimmed mean calculator
Average a dataset after removing a chosen share from each end.
A clear answer. Here’s how.
Sorts values and removes floor(n×trim/100) observations from each tail, then takes the mean of the retained values. Reports actual counts removed and retained. This is a symmetric trimmed mean; values are removed by rank rather than by a numeric cutoff.
How this is checked
4 reference checks passed These 4 cases were run when this page was built, on 3 December 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.
See the checks and where each expected answer comes from
Case 1
- Inputs
- Values, separated by commas or new lines 2, 4, 4, 4, 5, 5, 7, 9Percentage removed from each tail 25
- Expected, and what Toolmoz gave
- Trimmed mean expected 4.5, Toolmoz 4.5Removed from each tail expected 2, Toolmoz 2Retained observations expected 4, Toolmoz 4
- Where the expected answer comes from
- Remove floor(8 × 0.25) = 2 from each end, leaving 4, 4, 5, 5 with mean 18 ÷ 4 = 4.5
- Allowed difference
- ±1e-12 relative
Case 2
- Inputs
- Values, separated by commas or new lines 1, 2, 3, 4, 100Percentage removed from each tail 20
- Expected, and what Toolmoz gave
- Trimmed mean expected 3, Toolmoz 3Removed from each tail expected 1, Toolmoz 1Retained observations expected 3, Toolmoz 3
- Where the expected answer comes from
- Remove floor(5 × 0.2) = 1 from each end, leaving 2, 3, 4 with mean 3; the outlier 100 no longer matters
- Allowed difference
- ±1e-12 relative
Case 3
- Inputs
- Values, separated by commas or new lines 1, 2, 3, 4, 5, 6, 7, 8, 9, 10Percentage removed from each tail 20
- Expected, and what Toolmoz gave
- Trimmed mean expected 5.5, Toolmoz 5.5Removed from each tail expected 2, Toolmoz 2Retained observations expected 6, Toolmoz 6
- Where the expected answer comes from
- Remove floor(10 × 0.2) = 2 from each end, leaving 3 to 8 with mean (3 + 8) ÷ 2 = 5.5
- Allowed difference
- ±1e-12 relative
Case 4
- Inputs
- Values, separated by commas or new lines 2, 4, 4, 4, 5, 5, 7, 9Percentage removed from each tail 10
- Expected, and what Toolmoz gave
- Trimmed mean expected 5, Toolmoz 5Removed from each tail expected 0, Toolmoz 0Retained observations expected 8, Toolmoz 8
- Where the expected answer comes from
- floor(8 × 0.1) = floor(0.8) = 0 values are removed, so the result is the plain mean 40 ÷ 8 = 5
- Allowed difference
- ±1e-12 relative
What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Values, separated by commas or new lines
- 2, 4, 4, 4, 5, 5, 7, 9
- Percentage removed from each tail
- 10
Example result
- Trimmed mean
- 5
- Removed from each tail
- 0
- Retained observations
- 8