Convert median and IQR to mean and SD

To convert a median and IQR to a mean and SD, this calculator uses Luo et al.’s (2018) weighted average of the median and the quartiles for the mean, and Wan et al.’s (2014) IQR divided by a sample-size factor close to 1.35 for the SD. It can also estimate the mean from the median and range, or from all five numbers.

Updated

Runs in your browser. Nothing you enter is uploaded, stored or sent anywhere.

How the median to mean conversion works

Which formulas apply depends on what the study reports. With n participants, minimum a, first and third quartiles q1 and q3, median m and maximum b:

Mean from Luo et al. (2018), equations 7, 11 and 15. SD from Wan et al. (2014), equations 9, 13 and 16.

  • Median and IQR

    Estimated mean
    (0.7 + 0.39/n) × (q1 + q3)/2 + (0.3 − 0.39/n) × m
    Estimated SD
    (q3 − q1) ÷ η(n)
  • Median and range

    Estimated mean
    w × (a + b)/2 + (1 − w) × m, where w = 4 ÷ (4 + n^0.75)
    Estimated SD
    (b − a) ÷ ξ(n)
  • All five

    Estimated mean
    w₁ × (a + b)/2 + w₂ × (q1 + q3)/2 + (1 − w₁ − w₂) × m, where w₁ = 2.2 ÷ (2.2 + n^0.75) and w₂ = 0.7 − 0.72 ÷ n^0.55
    Estimated SD
    (b − a) ÷ 2ξ(n) + (q3 − q1) ÷ 2η(n)

The two sample-size factors, where Φ⁻¹ is the inverse of the standard normal distribution:

  • ξ(n) = 2 × Φ⁻¹((n − 0.375) ÷ (n + 0.25)), for the range;
  • η(n) = 2 × Φ⁻¹((0.75n − 0.125) ÷ (n + 0.25)), for the IQR.

The mean is from Luo et al. and the SD from Wan et al.. As n grows, η(n) approaches 1.35, the divisor the Cochrane Handbook gives for an IQR in large, roughly normal samples (section 6.5.2.5). Wan’s version corrects it for smaller ones. The weights lean more on the median as the sample grows, because the extremes and quartiles of a large sample tell you less about its mean.

Worked example

A hypothetical trial reports systolic blood pressure as a median of 142 mmHg with an IQR of 131 to 155, in 120 participants. It’s the example the calculator opens with.

Example: Working it through

Mean: the weight on the quartiles is 0.7 + 0.39 ÷ 120 = 0.70325, so the mean is 0.70325 × (131 + 155) ÷ 2 + 0.29675 × 142 = 142.7.

SD: η(120) = 2 × Φ⁻¹(89.875 ÷ 120.25) = 1.333, so the SD is (155 − 131) ÷ 1.333 = 18.01.

If the range, 104 to 189, were reported too, the five-number formulas would give a mean of 142.9 and an SD of 17.3.

Luo et al. tried their method on a published meta-analysis of vitamin D and tuberculosis. In its first study, 40 cases had a median of 16.0 nmol/L (range 2.25 to 74.25) and 40 controls 27.25 nmol/L (9.0 to 132.5). This calculator gives the cases a mean of 20.47 and an SD of 16.69, and the effect size in Luo et al.’s Table 3, d = 0.6622, follows from these estimates.

IQR to SD: divide by about 1.35

To estimate an SD from an IQR, divide the IQR (q3 − q1) by about 1.35. The Cochrane Handbook gives SD ≈ IQR ÷ 1.35 for large samples from a roughly normal distribution (section 6.5.2.5). The 1.35 is 2 × Φ⁻¹(0.75), or 1.34898, which is how many SDs wide a normal distribution’s IQR is.

Wan et al. showed that a small sample’s IQR is expected to be less than 1.35 SDs wide, so they divide by η(n) instead, which grows towards 1.35 as n grows. This calculator uses their formula. For an IQR of 10:

η(n) by Wan et al.’s equation 16, and the SD it gives for an IQR of 10.
Participants, nη(n)SD from an IQR of 10
211.2587.95
411.3027.68
1011.3307.52
10011.3477.42
Very large1.3497.41

The calculator asks for the median as well, because it estimates the mean at the same time. The SD doesn’t depend on it: any median between the quartiles gives the same SD. If the data are skewed, the Handbook says an SD can’t be estimated from an IQR at all, as “When not to convert” below explains.

Wan et al. (2014): median to mean

Wan et al., in BMC Medical Research Methodology in 2014, estimate a sample’s mean and SD from its size and median plus the range, the IQR or both. For a median and IQR, their mean is the average of the three numbers, (q1 + m + q3) ÷ 3 (equation 14), and their SD is the IQR divided by η(n) (equations 15 and 16).

This calculator uses Wan’s SD but takes the mean from Luo et al. (2018), a later paper with Wan among its authors. Its weights change smoothly with the sample size, and the authors report that their estimators “improve the existing ones significantly”. In practice the two means are close. For the example above, Wan’s gives (131 + 142 + 155) ÷ 3 = 142.67, and Luo’s gives 142.70.

If you used this page, cite both papers: Wan et al. (2014) for the SD and Luo et al. (2018) for the mean.

When not to convert

Both methods assume the data are roughly normal. A median is often reported precisely because the data are skewed, and then an estimated mean and SD can be well off.

  • Skewed data. The Cochrane Handbook says that when the outcome’s distribution is skewed, “it is not possible to estimate a SD from an interquartile range” (section 6.5.2.5). The calculator warns when the median is at least twice as far from one end of the IQR or range as from the other.
  • Ranges. The Handbook recommends that, as a general rule, ranges should not be used to estimate SDs (section 6.5.2.6). A range grows with the sample size and rests on the two most extreme values.
  • Imputed means. The Handbook mentions Wan’s formula for a missing mean from the quartiles and notes it performed well even with skewed outcomes in one simulation study (section 6.5.2.9). Luo et al. later refined that formula. Either way, the Handbook’s caveats on imputing values apply (section 6.5.2.7).
  • Check the effect. If converted studies could change your conclusion, run the meta-analysis again without them and report both.

What to report

What to report: Name the method and the studies

Say which studies’ means and SDs you estimated, what each one reported, and the methods: Luo et al. (2018) for the mean and Wan et al. (2014) for the SD. The summary under the result is ready to paste.

OtterSR’s extraction stage proposes each value with the passage it came from, so you can see whether a study reported an IQR or a range. Its Write stage can then make the same conversion, Luo’s mean and Wan’s SD, for the studies that report a median instead of a mean and SD, and records each conversion, flagging a study whose data look skewed. See how OtterSR works.

Frequently asked questions

Can I convert a median to a mean?

Only as an estimate, and only when the data are roughly symmetrical. The median alone isn’t enough: you also need the sample size and the IQR, the range or both. When the data are clearly skewed, a converted mean can mislead, so consider keeping those studies out of the pooled analysis.

How does Cochrane suggest converting a median to a mean?

The Handbook notes that a median is very similar to the mean when the data are symmetrical and can occasionally be used directly, and cites Wan’s and Bland’s formulas for estimating the mean (section 6.5.2.9). For the SD it gives the IQR divided by 1.35 for large, roughly normal samples, and points to Wan’s correction for sample size (section 6.5.2.5).

Why not just divide the IQR by 1.35?

For large samples that’s almost what Wan’s formula does, since η(n) approaches 1.35. For small samples η(n) is smaller, 1.30 for 41 people, so dividing by 1.35 makes the SD a little too small.

Can I estimate the mean from the median and range?

Yes: leave the quartiles blank and enter the minimum and maximum, and the calculator uses Luo et al.’s range formula. The Handbook advises against estimating SDs from ranges, though, so flag those studies and check whether they change your result.

How to cite this tool

OtterSR. Convert median and IQR to mean and SD. https://www.ottersr.com/tools/median-iqr-to-mean-sd (accessed today’s date).

Please cite the method as well:

  • Luo D, Wan X, Liu J, Tong T. Optimally estimating the sample mean from the sample size, median, mid-range, and/or mid-quartile range. Statistical Methods in Medical Research 2018;27(6):1785–805.

  • Wan X, Wang W, Liu J, Tong T. Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range. BMC Medical Research Methodology 2014;14:135.

Sources

  1. Luo D, Wan X, Liu J, Tong T. Optimally estimating the sample mean from the sample size, median, mid-range, and/or mid-quartile range. Statistical Methods in Medical Research 2018;27(6):1785–805. https://doi.org/10.1177/0962280216669183
  2. Wan X, Wang W, Liu J, Tong T. Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range. BMC Medical Research Methodology 2014;14:135. https://doi.org/10.1186/1471-2288-14-135
  3. Higgins JP, Li T, Deeks JJ (editors). Chapter 6: Choosing effect measures and computing estimates of effect [last updated August 2023]. In: Higgins JP, Thomas J, Chandler J, et al (editors). Cochrane Handbook for Systematic Reviews of Interventions version 6.5. Cochrane, 2024. https://www.cochrane.org/authors/handbooks-and-manuals/handbook/current/chapter-06