Home › Statistics & Probability › Weighted Average Calculator
Weighted Average Calculator
Computes the weighted arithmetic mean Σ(w·x) / Σw of a list of values and a matching list of weights, along with the total weight and the unweighted mean for comparison.
When to use
Values contribute unequally to an average: course grades with credit weights, portfolio returns by allocation, survey answers with sampling weights, average price over different quantities.
Do not use when: All items count equally (use descriptive-statistics for the plain mean), or the weights are probabilities of outcomes (use expected-value, which also gives the variance).
Formula
weighted_average = Σ(values_i × weights_i) / Σ weights_i
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
values | number_list | yes | The values to average. | |
weights | number_list | yes | Non-negative weight for each value, in the same order (percentages, credits, quantities); they need not sum to 1. |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
weighted_average | number | Σ(values × weights) / Σweights. | |
total_weight | number | Sum of the weights. | |
weighted_sum | number | Σ(values × weights) before dividing by the total weight. | |
simple_average | number | Plain arithmetic mean of the values, for comparison. | |
count | integer | Number of value/weight pairs. |
Example
Grades 90, 80, 70 weighted 50/30/20 %: {"values":[90,80,70],"weights":[0.5,0.3,0.2]} → {"weighted_average":83,"total_weight":1,"weighted_sum":83,"simple_average":80,"count":3}
4, 8, 15 with weights 2, 1, 1: {"values":[4,8,15],"weights":[2,1,1]} → {"weighted_average":7.75,"total_weight":4,"weighted_sum":31,"simple_average":9}
GET https://tttkmbb.com/api/v1/calculate/weighted-average?values=90%2C80%2C70&weights=0.5%2C0.3%2C0.2
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/weighted-average(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/weighted-average · Markdown: https://tttkmbb.com/statistics/weighted-average.md · JSON definition: https://tttkmbb.com/statistics/weighted-average.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="weighted-average" - OpenAPI operationId:
calculate_weighted_average - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
FAQ
Do the weights have to add up to 1 or 100?
No. The result is divided by the total weight, so 50/30/20, 5/3/2 and 0.5/0.3/0.2 all give the same average.
What if a weight is zero?
That value is ignored. At least one weight must be positive; negative weights are rejected.
Related calculators
- Descriptive Statistics Calculator — Unweighted mean, median and spread of a list.
- Expected Value Calculator — Probability-weighted mean and variance of outcomes.
- GPA Calculator — Credit-weighted grade point average.