The magnitude of the effect of an intervention on a quantitative outcome may be expressed as a standardized mean difference by dividing the difference in means by the standard deviation of the outcome. This is useful to compare outcomes measured using different scales, especially in meta-analysis. However, uncertainty about the standard deviation leads to complicated formulae to avoid bias and to compute the correct standard error. We review approximate and exact formulae and argue for the use of the exact formulae. We then extend the formulae to cluster-randomized trials, and show how the calculations may be implemented using published results. We also describe methods for estimating the standard deviation. Various pitfalls are identified which can lead to major errors especially in the cluster-randomized setting.