Calculators

Weighted Median Calculator

Find the weighted median of signed values and non-negative weights privately in your browser.

Find the first sorted value whose cumulative weight reaches at least half the total. Exact half-weight ties return the lower value. Zero-weight pairs are ignored. Your data stays in your browser.

Enter one pair per line: value, weight (for example 10, 1; 20, 3; and 100, 1 on separate lines give a weighted median of 20). Separate each value and weight with a comma, semicolon, or space. Use signed finite values and non-negative weights, with at least one positive weight. Up to 10000 pairs; scientific notation supported; omit thousands separators.

Your weighted median will appear here.

Find the halfway point of cumulative weight.

Sort value and weight pairs by value, then choose the first value whose cumulative weight reaches at least half the total: the lower weighted median. For 10 with weight 1, 20 with weight 3, and 100 with weight 1, the weighted median is 20. With equal weights on 10 and 20, this tool returns 10, rather than averaging the middle values to 15. Other software may use a midpoint or interpolation at ties. Values may be signed or zero; weights must be non-negative with at least one positive weight. Zero-weight rows are ignored. Relative weights need not sum to one. Enter up to 10000 pairs, one per line, using a comma, semicolon or spaces within each pair. Scientific notation is accepted; omit thousands separators and use consistent units. The result has the same units as the values. Normalized weights and compensated sums limit overflow and rounding error, but browser floating-point precision can affect near-half ties or discard extremely small relative weights. Results display up to 12 significant digits. All processing stays in your browser.

Frequently Asked Questions

Everything you need to know about this tool, how it works, and privacy.

How is the weighted median calculated?

Sort values in ascending order and accumulate their weights. Return the first value reaching at least half the total weight. For 10, 20, and 100 with weights 1, 3, and 1, the result is 20.

What happens at an exact half-weight tie?

This tool uses the lower weighted median. Two equally weighted values 10 and 20 return 10. A midpoint convention would instead return 15; neither convention should be silently mixed with the other.

Which values and weights are accepted?

Values can be positive, negative or zero. Weights must be non-negative finite numbers and at least one weight must be positive. Zero-weight rows are ignored.

How does this differ from a weighted average?

A weighted average multiplies each value by its weight and divides the sum by total weight. A weighted median selects a value at the halfway point of cumulative weight and is less sensitive to the magnitude of extreme values.

Is the calculation private and exact?

Data stays in your browser. Floating-point arithmetic may affect near-half ties and extremely small relative weights. Results are rounded to 12 significant digits.