Weighted Average Calculator
Calculate a weighted mean from value–weight pairs, with normalized shares and CSV reports.
This tool processes its input contents in your browser instead of sending them to a processing service. Page, asset and fixed usage-measurement requests are described on the Privacy page.
Calculate a general weighted mean from nonnegative weights, with normalized shares, row contributions and a reproducible local audit.
How to use it
- 1Paste value, weight pairs, or select two different numeric CSV columns.
- 2For CSV, choose whether incomplete pairs are rejected or explicitly omitted.
- 3Calculate and review the average, positive-weight rows and contribution audit.
- 4Download every row as CSV or keep the full method and exact sum audit as JSON.
Example
- Input
- (10, 2), (20, 3), (40, 5)
- Output
- Weighted average 28; total weight 10.
Weights need not total 100. Values may be negative; weights must be nonnegative with at least one positive.
What happens to your data
Pairs and files remain in browser memory, with no dataset upload or stored history. Optional analytics uses fixed labels, never numeric values, column names or filenames.
Last updated November 2026
A weighted average gives observations different influence instead of treating every row equally. Enter value–weight pairs, or map two numeric CSV columns, to see the average and a row-by-row contribution audit. Weights can be counts, percentages or relative importance; they do not need to total 100.
This is a general weighted-mean workbench for measurements, frequency tables and repeated observations. Zero-weight rows remain visible, incomplete CSV pairs are handled together, and downloads preserve every accepted record rather than only the preview.
How it works
The weighted mean is Σ(value × weight) / Σ(weight). Values may be positive, zero or negative. Weights must be nonnegative, and at least one must be positive. A zero-weight row contributes zero and has no effect on the mean. The result lies within the range of positive-weight values in exact arithmetic. A negative weight is rejected because it changes the interpretation and can place the result outside that range. Frequency, percentage and relative weights all use the same formula; multiplying every weight by the same positive constant leaves the mathematical average unchanged. Input rounding and range limits still apply.
Each row's normalized share is weight / total weight. Its contribution is value × weight / total weight. Contributions add to the weighted mean before rounding. The table rounds values for readability; separately rounded contributions may not sum to the displayed answer, especially when large positive and negative terms cancel. Use the exported numerical audit rather than inferring an exact identity from rounded columns. A weighted average is not automatically a weighted median, a pooled variance, a financial return, or an appropriate combination of percentages that have different denominators. Choose weights that match the question.
The implementation decodes accepted IEEE 754 binary64 numbers as integers times powers of two. Weight totals and value×weight products are accumulated as bounded exact integers, and division is performed before the rounded result is reported. This avoids first overflowing a raw product or losing a small term through mixed-sign cancellation in an ordinary floating sum. It is exact accumulation of the accepted browser numbers, not exact arithmetic on original decimal strings. Reported ratios, normalized shares and contributions are rounded browser numbers. JSON includes the integer sums and their binary exponents to support independent reconstruction; it does not contain a hidden model or a prediction.
Both tools use decimal-point numbers, optionally in e notation, with at most 200 characters per numeric token. Nonzero magnitudes must be from 1e−100 to 1e100. Infinity, NaN, arithmetic expressions, units and grouping marks are rejected. A decimal whose normalized spelling cannot survive a round trip through a browser number is rejected rather than silently losing input digits. This does not make numbers exact decimals: 0.1 still has a binary approximation. Input is limited to 1 MiB of valid UTF-8, 10,000 list values or pairs, or 10,000 CSV records including the header, under shared 200-column and 200,000-cell guards. Local files must be nonempty. CSV needs a header row with unique, nonblank names and consistent field counts. Choose comma, semicolon or tab explicitly, select the numeric columns, and decide whether blank selected cells must be rejected or omitted. Non-numeric selected cells are always rejected with a source record number. Omitted CSV records are counted; unrelated text columns are not analyzed. In pair mode, use exactly two numbers per nonblank line, value first and weight second, separated by a comma or whitespace. One pair is sufficient when its weight is positive. Blank lines are ignored. In CSV mode, choose different columns for value and weight. Under the explicit omit policy, an incomplete pair is omitted as a whole, so values are never accidentally matched with weights from another record.
The main result shows the mean, total weight, accepted rows, positive-weight rows and zero-weight rows. The table previews up to 20 records. Row CSV includes every record's value, weight, normalized share and contribution. Analysis JSON includes every row, source mapping, omitted count, method and exact binary64 sum audit. Changing any input or setting clears the old result.
Inputs stay in browser-tab memory: no dataset upload, stored history or data in the URL. Editing data or calculation settings removes stale results and exports. Optional analytics uses fixed action labels and input mode, never numeric values, filenames or column names. JSON downloads deliberately contain the accepted input observations and calculation settings so you can retain an audit locally; share them only when appropriate.
Worked example: Weights do not need to be percentages
- Input
- Value, weight pairs: (10, 2), (20, 3), (40, 5)
- Result
- Weighted average = (10×2 + 20×3 + 40×5) / 10 = 28. Shares: 20%, 30%, 50%. Contributions: 2, 6, 20.
Adding any valid value with weight zero leaves the mean unchanged.
Common use cases
- Combine measurements that represent different numbers of observations using frequency weights.
- Compare values with explicit nonnegative importance weights without forcing them to total 100.
- Audit a CSV calculation with original source record numbers and per-row contributions.
- Check a mixed-sign dataset without losing a small term in an ordinary floating-point sum.
Frequently asked questions
Do the weights have to add up to 100?+
No. Counts, percentages and relative weights work. The calculator divides by their actual total. Weights 2, 3, 5 produce the same mathematical result as 20, 30, 50.
Can a value or weight be negative?+
Values can be negative. Weights cannot; at least one must be positive. Zero-weight rows are accepted and retained but have no influence.
Why do the displayed contributions not add up exactly?+
Each displayed or exported ratio is rounded independently. Large positive and negative contributions can make that difference noticeable. The mean is calculated directly from the full accumulated value×weight sum, and JSON includes its exact binary64 sum audit.
Can I average percentages with this?+
Only if your weights represent the appropriate denominators or agreed importance. Averaging rates with arbitrary weights can be misleading. The tool applies the formula; it cannot verify that the weights match your problem.
Does the CSV omit policy remove zero values?+
No. Zero is a valid number. Only a genuinely blank selected value or weight causes the whole pair to be omitted under the explicit omit policy. Other invalid numeric text remains an error.
Standards and limitations
Related tools
Histogram Maker
Make a histogram from numbers or a CSV column. Export charts and audited bin counts.
Standard Deviation Calculator
Analyze a list or CSV column with sample/population spread, quartiles, outlier flags and exports.
Fraction Calculator
Add, subtract, multiply, divide or simplify fractions and mixed numbers with exact steps.
CSV Data Profile
Inspect CSV column counts, empties, distinct values and duplicate rows locally; export a JSON profile.