Calculators
Weighted average calculator
Enter one value and weight pair per line, and this browser-based weighted average calculator returns the mean, the total weight, the weighted sum and each row's contribution. It suits exam grades, survey scores and portfolio allocations, or any other numbers that carry different weights.
Weighted average
Enter your pairs, then select Calculate to see the result.
Weighted average · approximate
- Total weight
- Weighted sum
- Rows
Contribution breakdown
Scroll the table sideways if needed to see every contribution.
| Line | Value | Weight | Share | Contribution |
|---|
Native floating-point arithmetic, about 15–17 significant digits. Inputs, totals, shares and results may be rounded. Cancellation can lose precision. Totals outside the numeric range are labeled; weighted sum is reconstructed from the approximate mean and total weight.
How to use the weighted average calculator
Type or paste one value and weight pair per line in Value, weight pairs, separated by a comma, tab or space. Use a dot for decimals or scientific notation such as 1e6; leave out headers, thousands separators and % signs. Blank lines are ignored.
Weights must be nonnegative and can use any consistent scale, so 1, 2, 1 gives the same shares as 25, 50, 25; they do not need to total 100. The order you list the pairs does not change the weighted average, except when large positive and negative values cancel; then floating-point rounding can make a reordered list give a different result.
Select Calculate, or Cancel if a large table takes a moment to finish. The result lists Total weight, Weighted sum and Rows, then a Contribution breakdown table with each row's line number, value, weight, share and contribution in entry order. Copy result copies one line, such as "Weighted average (approximate): 90", and Download text saves the whole table to weighted-average.txt.
How the weighted average and shares are calculated
The weighted average is the sum of each value times its weight, divided by the sum of the weights: sum(value × weight) / sum(weight). For 80 with weight 1, 90 with weight 2 and 100 with weight 1, the weighted sum is 360 and the total weight is 4, giving a weighted average of 90.
Each row's share is its weight divided by the total weight, shown as a percentage: 25%, 50% and 25% for this example. A row's contribution is its value times its share, so 80 contributes 20, 90 contributes 45 and 100 contributes 25, and the three contributions sum back to the weighted average, 90.
A zero weight is valid and stays in the table with a 0% share and a 0 contribution; it does not affect the result, since the row's share is also 0. To keep a category with no score yet in the table, enter it as 0, 0.
Limits
The calculator finds one weighted mean from value and weight pairs entered as plain text; it has no built-in course or grade categories, unlike a dedicated grade calculator that fills missing categories for you. Each line needs exactly one value and one weight, separated by a comma, tab or space; a missing weight is an error, not an implied zero.
Weights must be nonnegative; a negative weight is rejected, and if every weight is zero the weighted average is undefined and returns an error. A header row or a % sign is rejected as invalid text, and a thousands separator such as 1,000 splits into extra fields instead of being read as one number.
The math uses the browser's native floating-point arithmetic, about 15 to 17 significant digits, so inputs, totals, shares and results may be rounded, and cancellation between large opposite-signed values can lose precision. There is no arbitrary row or digit cap; a result or contribution outside the browser's numeric range returns an error.
Questions
How do you calculate the weighted average?
Multiply each value by its weight, add the results together, then divide by the sum of the weights: sum(value × weight) / sum(weight). For grades of 80, 90 and 100 weighted 20%, 30% and 50%, enter 80, 20 / 90, 30 / 100, 50 as three lines. The contributions are 16, 27 and 50, so the weighted average is 93.
What is the difference between an average and a weighted average?
A plain average treats every value the same. A weighted average lets each value's weight decide how much it counts, so a value with a larger weight moves the result more. If every weight is equal, a weighted average gives the same result as a plain average of the same values.
Can I use zero or missing weights?
A missing weight is an error, since a blank is not read as zero. A trailing comma with nothing after it is treated the same way, as a missing weight. If every weight is zero, the weighted average has no defined value and the calculator returns an error.
Can I use percentages, credits or frequencies as weights?
Yes. Enter percentage numbers without the % sign, or use credit counts, frequencies or decimal proportions instead. Every weight is relative, divided by the total of whatever scale you choose. For course credit hours of 3, 4 and 3 with grades 70, 85 and 90, the weighted average is 82.
Why is the answer approximate?
The browser uses finite floating-point numbers, so long integers and decimal fractions may be rounded on input, and subtracting two close large values can lose precision. The result shows the browser's actual numeric representation, including scientific notation when a value is very large or very small.