Statistical analysis

Median and percentile calculator

Paste numbers from a survey or a spreadsheet. Get the median, quartiles Q1 and Q3, the interquartile range and any percentile you choose.

  • Checked against reference values
  • Free, no sign-up
  • Nothing leaves your browser

Enter survey data

Separate with commas, spaces or new lines, or paste a column

Any percentile, for example 90, 95 or 99.5

Assumptions and limitations

  • Linear interpolation between order statistics (Hyndman–Fan type 7, the same as Excel PERCENTILE.INC and the default in R and NumPy)
  • Median = P50 = Q2
  • Text that is not a number is ignored
Median
—
Enter data

Collect real answers in a SurveyNinja survey and see them in charts in the report.

Use this template See the questions first

Data is not stored — calculation runs in your browser.

Ready-made template

Do it with your own respondents

The “Likert scale survey” template already has the questions. Put in your company name, share the link and watch the answers come in.

  1. Copy the template: the questions are written
  2. Share it by link, QR code or a widget on your site
  3. Read the results in the report with charts

New accounts get 14 days of Premium features, no credit card.

What are the median and percentiles?

The median is the middle value of a sorted list of numbers: half of the values are at or below it, half at or above. A percentile Pk is the value at or below which about k% of the data lie, so the median is P50 and the quartiles Q1 and Q3 are P25 and P75. Between two data points the value is interpolated linearly.

Median and percentiles

  • Median

    The value in the middle of the sorted sample; for an even n, the average of the two central values (for 10, 15, 20, 25, 30, 35, 40, 50 it is the average of 25 and 30, 27.5). Unlike the mean, it barely moves when a few values are extreme.

  • Quartiles and IQR

    Q1 has 25% of the data below it, Q2 is the median, Q3 has 75% below it. The interquartile range IQR = Q3 − Q1 is the spread of the middle half of the data.

  • How percentiles are computed

    Sort the n values and take position h = (n − 1) × k / 100, counting from 0. If h falls between two values, interpolate linearly: x[⌊h⌋] + (h − ⌊h⌋) × (x[⌊h⌋+1] − x[⌊h⌋]). For 3, 5, 6, 7, 7, 8, 8, 9, 9, 10, Q1 sits at h = 2.25: 6 + 0.25 × (7 − 6) = 6.25.

  • Outliers: the 1.5 × IQR rule

    Tukey's fences flag values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR as possible outliers; values beyond 3 × IQR are far out. The rule tells you which values to check. Whether to drop one depends on why it is there.

  • Median vs mean in skewed data

    Time to complete a survey is typically skewed: most people finish in a few minutes, and a few leave the tab open and come back much later. The mean follows that long tail, while the median stays with the typical respondent. Report the median, and add P90 to show the tail.

  • When to use

    The median suits skewed data with outliers, such as income or response time. Percentiles suit service targets ("95% of responses within N seconds") and the time users take to complete a task.

Interpretation examples

  1. Scores on a 1–10 scale

    • Data: 3, 5, 6, 7, 7, 8, 8, 9, 9, 10. n = 10.

    Median = 7.5, Q1 = 6.25, Q3 = 8.75, IQR = 2.5. Half of the scores are 7.5 or lower. In a report: "median satisfaction 7.5 out of 10".

  2. Time to complete a survey (minutes)

    • Data: 3, 4, 4, 5, 5, 6, 6, 7, 9, 38. One respondent left the survey open for 38 minutes.

    Median = 5.5 min, mean = 8.7 min. Replace 38 with 10 and the median stays at 5.5 while the mean drops to 5.9. In a report: "half of respondents finish within 5.5 minutes".

  3. Cost per customer: finding outliers

    • Acquisition cost sample: 2, 3, 4, 5, 5, 6, 8, 10, 15, 25.

    Median = 5.5, while the mean is 8.3 because of the high values. Q1 = 4.25, Q3 = 9.5, IQR = 5.25, so the upper fence is 9.5 + 1.5 × 5.25 = 17.375 and 25 is a possible outlier to check. P90 = 16: about 90% of customers cost 16 or less.

  4. Response time against a target (seconds)

    • Target: P95 below 3 s.
    • Measurements: 1.2, 1.5, 1.8, 2.0, 2.1, 2.3, 2.4, 2.6, 2.9, 3.4. Set the percentile field to 95.

    Median = 2.2 s, P90 = 2.95 s, P95 = 3.175 s. The target is missed, although nine of ten measurements are under 3 s.

  5. Time to purchase (days)

    • Data: 1, 1, 2, 3, 5, 7, 10, 14, 21, 30 days from first visit to conversion.

    Median = 6 days: half of the customers convert within 6 days. P75 = 13 and P90 = 21.9 show the long tail.

  6. Session length (minutes)

    • Measurements: 0.5, 1, 2, 3, 4, 5, 8, 12, 20, 45. Set the percentile field to 95.

    Median = 4.5 min, P95 = 33.75 min. The median is the typical session; P95 marks where the longest sessions begin.

Which spreadsheet and code functions give the same result

The methods agree on the median and differ on other percentiles mostly in small samples.

Tool Same method as this calculator (type 7) Different method
Excel PERCENTILE.INC, QUARTILE.INC, MEDIAN PERCENTILE.EXC, QUARTILE.EXC
Google Sheets PERCENTILE, QUARTILE, MEDIAN PERCENTILE.EXC, QUARTILE.EXC
R quantile(x), default type = 7 quantile(x, type = 6) and other types
Python numpy.percentile, pandas quantile (defaults) statistics.quantiles (default method "exclusive")

What to avoid

  1. Comparing quartiles computed by different methods

    Excel QUARTILE.EXC and Python statistics.quantiles use another rule than QUARTILE.INC and NumPy, so the same 10 numbers can give different Q1 and Q3. Use one method across reports.

  2. Deleting every value outside the fences

    The 1.5 × IQR rule marks values to check. A 38-minute completion may be a real person who took a break. Remove a value only for a stated reason, such as a test entry or a typo, and report how many you removed.

  3. Reporting only the mean for skewed data

    For times, costs and incomes a few large values pull the mean up. Give the median, and the mean next to it if readers expect it.

  4. High percentiles from very few values

    With 10 values, P95 is interpolated between the two largest. With a small sample, report the maximum or collect more data before quoting P95 or P99.

The SurveyNinja ninja with survey templates

Next step

Collect the data for this analysis

Build the survey in SurveyNinja, share the link in your email or chat, or as a QR code, and export the answers to Excel, CSV or SPSS on every plan.

  • Ready questions or AI from a description
  • A link for your email or chat, a QR code or a widget on your site
  • Charts in the report, export to Excel, CSV and SPSS

Frequently asked questions about median and percentiles

What is the median?

The value in the middle of the sample after sorting. Half of the data are at or below the median, half at or above. Outliers barely affect it.

How does the median differ from the mean?

The mean is the sum divided by the count and is pulled by outliers. The median is the central value and is often preferred for skewed data.

What is a percentile?

Percentile Pk is the value at or below which about k% of the data lie. P50 is the median, P90 has 90% of the data at or below it.

Can I calculate any percentile?

Yes. Type any value from 0 to 100 in the percentile field, decimals included (for example 99.9). P0 is the minimum and P100 the maximum.

What are quartiles?

Quartiles split the sample into four parts: Q1 (25%), Q2, the median (50%), and Q3 (75%). IQR = Q3 − Q1 is the spread of the middle half.

How do I find outliers with the IQR?

Take Q1 and Q3 from the calculator and compute IQR = Q3 − Q1. Values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are possible outliers (Tukey's fences); beyond 3 × IQR they are far out. Check those values before deciding what to do with them.

How to enter numbers?

Separate them with commas, spaces or new lines. You can paste a column from a spreadsheet; text that is not a number is ignored.

Where are percentiles used in research?

In service targets (95% of responses within N seconds), in comparing segments by their median, and in analysing how long tasks take.

Which percentile method does the calculator use?

Linear interpolation between order statistics, type 7 in the Hyndman–Fan classification. It matches Excel PERCENTILE.INC and QUARTILE.INC, Google Sheets PERCENTILE and the defaults of R quantile() and NumPy. Other methods (Excel PERCENTILE.EXC, type 6) can give slightly different quartiles on small samples.

Learn the method

Read how the method works and where its numbers come from.

The SurveyNinja ninja takes off on a rocket

Turn the numbers into a survey

Start from the “Likert scale survey” template: the questions are ready.