Calculate the root mean square (RMS) of a list of numbers, or the RMS value of a sine, square or triangle wave from its peak, as used for mains voltage and audio levels.
RMS = √((x₁² + x₂² + … + xₙ²) ÷ n)
Negative values are fine: RMS treats −10 and +10 the same.
The root mean square is the square root of the average of the squared values. It's an average of size that ignores sign, so −10 and +10 count the same.
That makes it the right average for anything that swings between positive and negative, where the ordinary mean comes out close to zero. UK mains electricity is called 230 volts even though it swings between roughly +325 V and −325 V fifty times a second: 230 V is its RMS value, the steady voltage that would heat a kettle just as well.
The same calculation underlies the root mean square error (RMSE) used to judge forecasts and models, and it's how audio and vibration levels are usually measured.
Waveform factors as given in standard electronics references such as Horowitz and Hill. See Sources.
Squaring makes every value positive and gives larger values more weight.
The second line shows why RMS is never smaller than the size of the mean: it adds the spread on top. For data centred on zero, RMS equals the standard deviation.
The RMS is above the mean of 25 because squaring gives the bigger values more weight. And a 230 V supply actually peaks at about 325 V.
For a peak amplitude of 1; multiply by your peak. The crest factor (peak ÷ RMS) says how "spiky" a signal is.
| Waveform | RMS | Crest factor | RMS for a 325 V peak |
|---|---|---|---|
| Sine | 0.7071 | 1.414 | 229.8 V |
| Square | 1 | 1 | 325 V |
| Triangle | 0.5774 | 1.732 | 187.6 V |
Because the heating power of a resistor depends on V², and the RMS value is the steady voltage with the same average V². A 230 V RMS supply heats a kettle exactly like 230 V DC would.
US household supply is about 120 V RMS, so the peak is about 120 × √2 ≈ 170 V.
Yes. “Quadratic mean” is another name for the root mean square.
Not smaller than the mean’s size. RMS is always at least the mean of the absolute values, and equal only when all values have the same size.
It measures the real RMS of any waveform. Cheaper meters measure an average and multiply by the sine-wave factor, which gives wrong readings for distorted signals.
Root mean square error: the RMS of the differences between predictions and actual values. It’s a standard way to measure how accurate a model or forecast is.
=SQRT(SUMSQ(range)/COUNT(range)).
Squares relate directly to power and energy in physics, and they have neat mathematical properties. Averaging absolute values gives a different measure, the mean absolute value.
Related Tools