ForHosting KIT · Developer Utilities

Mann-Whitney U Test Calculator with P-Value

The Mann-Whitney U test calculator compares two independent samples without assuming that their observations follow a normal distribution.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter both numeric groups to receive the smaller Mann-Whitney U statistic and a two-sided p-value from the normal approximation. The calculation uses average ranks for tied observations, adjusts the variance for ties, and applies a continuity correction. It is useful for exploratory analysis, experiment reviews, and reproducible checks when measurements are ordinal or continuous but a two-sample t-test is not a comfortable fit.

When the Mann-Whitney U test is appropriate

Use this calculator when you have two independent groups and want to assess whether observations from one group tend to rank higher or lower than observations from the other. Independence matters: a measurement in the first group must not be paired with, repeated from, or otherwise linked to a particular measurement in the second group. The test works with ordinal values and continuous measurements because it compares ranks rather than relying directly on means and standard deviations. It is often chosen when a normal sampling model is doubtful, when outliers make a mean-based comparison hard to interpret, or when an ordered scale does not support meaningful arithmetic differences. The test does not automatically establish that group medians differ. That interpretation needs similarly shaped distributions and a location-shift question. With differently shaped distributions, a significant result more generally indicates a difference in how values from the two populations are ordered. Decide the hypothesis and independence structure before looking at the p-value, and use subject knowledge alongside the numerical result.

How the statistic and p-value are calculated

The calculator combines both samples, sorts every observation, and assigns ranks from the smallest value to the largest. Equal observations receive the average of the ranks they occupy, so ties are treated consistently rather than broken arbitrarily. It then totals the ranks belonging to the first group and converts that rank sum into its group-specific U value. The other U value follows from the product of the two sample sizes, and the reported statistic is the smaller of those two values. For the p-value, the calculator uses the large-sample normal approximation under the null hypothesis. Its variance includes a correction based on every tie group in the pooled data, and the z calculation uses a continuity correction of one half. The reported p-value is two-sided, reflecting departures in either direction. If every pooled observation is identical, the tie-corrected variance is zero; the samples provide no ordering evidence, so the calculator returns a p-value of one. Results are deterministic for identical inputs.

How to read and report the result

The U statistic summarizes pairwise ordering between groups, but its raw scale depends on both sample sizes. Interpret it together with the sample sizes, the observed distributions, and the p-value rather than comparing raw U values across unrelated studies. A small two-sided p-value means the observed rank separation would be unusual under the null model used by the approximation; it is not the probability that the null hypothesis is true, and it does not measure practical importance. Before drawing a conclusion, inspect group sizes, ties, spread, influential observations, and the way the data were collected. Very small samples or extremely unbalanced groups can make an exact test preferable, while this capability intentionally returns the normal approximation. In a report, state that a two-sided Mann-Whitney U test was used, give both sample sizes, the reported U statistic, the p-value, and the chosen significance threshold. Add descriptive summaries or a plot so readers can see the magnitude and shape of the difference, not merely whether a threshold was crossed.

Compare independent experiment groups

Check whether outcomes from separate treatment and control samples show systematic rank separation without assuming normally distributed measurements.

Analyze ordinal survey responses

Compare ordered ratings from two unrelated respondent groups while respecting the ranking information in the scale.

Verify an analysis pipeline

Produce a deterministic U statistic and approximate p-value for fixtures, quality checks, or reproducible statistical workflows.

What does an API calculation cost?

Each API request costs $0.002. The same deterministic calculation can also run in the browser.

Is the p-value one-sided or two-sided?

It is two-sided, so it accounts for rank separation in either direction.

How are tied values handled?

Tied observations receive average ranks, and the normal approximation variance is corrected for pooled tie groups.

Does this calculator use an exact p-value?

No. It uses a tie-corrected normal approximation with a continuity correction, even for small samples.

Can either sample be empty?

No. Both groups must contain at least one finite numeric observation; an empty group returns an invalid-input error.

Does a significant result prove that the medians differ?

Not in every case. A median-shift interpretation generally requires similarly shaped group distributions; otherwise the result indicates broader rank-order differences.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/mann-whitney-u

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/mann-whitney-u \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"group_a":[1,3,5,7,9],"group_b":[2,4,6,8,10]}'
{
  "group_a": [
    1,
    3,
    5,
    7,
    9
  ],
  "group_b": [
    2,
    4,
    6,
    8,
    10
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.mann_whitney_u",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_items_per_group100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →