Population Median Confidence Interval Calculator

Enter a sample and choose central, lower, or upper bounds. Inspect the exact reference coverage for each rank, find the first sample size capable of meeting your target, and download the sorted observations and interval audit.

Order statistics

Find a confidence interval for the population median

Use sorted observations and exact binomial probabilities to choose a sample bound.

Sample and interval settings

Enter 1–120 observations in the same unit, separated by commas, tabs, or lines.

Enter a percentage from 50 to below 100.

A sample bound meets the requested coverage.

Recommended median interval

Interval

[5, 20]

Sample median 10.5

Reference coverage

97.8515625%

Exact fraction 501/512

Observations
10
Minimum sample size for this target
6
Candidate 2 interval
[5, 20]
Reference coverage
97.8515625%
Sample ranks
2 to 9
Coverage check
Meets requested coverage
Reference coverage and sample bounds
Coverage by rank and inspected intervalRank 2 has reference coverage 97.8515625%. The requested coverage is 95%. Its sample interval is [5, 20]. There are 10 distinct sample values.Reference coverage100%50%0%1Candidate rank5Sample values

The dashed line is the requested coverage. Larger dots represent repeated sample values.

The reference coverage assumes independent observations from the same continuous distribution. With discrete values or ties, the reference can be conservative.

Export the median interval audit

The CSV lists sorted observations, candidate ranks, and exact coverage fractions.

View CSV text

How to use this calculator

  1. Paste sample observations separated by commas, tabs, or line breaks.
  2. Enter the requested coverage and choose a central interval, a lower bound, or an upper bound.
  3. Read the recommended bounds, then move the candidate rank slider to see how coverage and endpoints change.
  4. Check the minimum sample size and download the exact audit if you need to reproduce the result.

The Formula

The mathematical logic powering this calculation is:

Sort the n observations as X₍₁₎ through X₍ₙ₎. Candidate rank r gives the central interval [X₍ᵣ₎, X₍ₙ₋ᵣ₊₁₎], the lower bound [X₍ᵣ₎, ∞), or the upper bound (−∞, X₍ₙ₋ᵣ₊₁₎]. In a continuous population, each independent observation falls below a fixed population median with probability one half. The count below that median follows Binomial(n, ½).

For the central interval the continuous-reference coverage is 1 − 2P(B ≤ r − 1), with r from 1 through floor((n + 1)/2). A one-sided bound uses 1 − P(B ≤ r − 1), with r from 1 through n. The calculator chooses the largest rank meeting the request in your chosen interval form, which gives the tightest bounds in that form. It compares the coverage and requested percentage as exact fractions. The minimum sample size is the first n for which rank 1 reaches the request in that form.

The reference coverage describes how often the procedure would include a fixed population median in repeated independent samples from the same continuous distribution. For discrete populations, either side of a fixed median has at least one-half probability when the median is included. The continuous-reference coverage is therefore a lower bound for the procedure's coverage in that case. Tied observed values keep all their ranks and can produce equal endpoints. The method depends on the sampling design, so interpreting clustered or selectively collected samples as independent draws can give misleading coverage.

Enter between 1 and 120 observations in the same units, with magnitudes up to 1,000,000 and up to six decimal places. Request a percentage from 50 to below 100 with up to eight decimal places. The chart uses decimal coordinates. The audit retains exact coverage and sample values as fractions.

Worked Example

If you input:

  • Sample values: 11, 5, 20, 4, 14, 8, 25, 10, 12, 9
  • Requested coverage: 95%
  • Interval type: Central

Result:

The interval is [5, 20] at ranks 2 and 9. Its exact reference coverage is 501/512, or 97.8515625%. The next narrower interval, [8, 14], has coverage 57/64, or 89.0625%.

Frequently Asked Questions

Why did the result exceed my requested coverage?

Each candidate uses whole sample ranks. The possible binomial coverages are discrete, so the tightest qualifying rank can exceed the request.

What if my sample is too small for the requested coverage?

The calculator shows the widest sample interval or bound in the chosen form as a preview and labels it below target. The minimum sample size indicates when that form first supports the requested coverage.

Can several sample values be equal?

Yes. Every observation keeps a rank. Tied endpoints can make the interval collapse to an observed value. The displayed binomial coverage remains a conservative reference for independently drawn discrete data.

Should I use a central interval or a one-sided bound?

Choose a central interval when both limits matter. Choose a lower bound to estimate a floor or an upper bound to estimate a ceiling. Choose the form before inspecting the observed values.

Similar Calculators