ForHosting KIT · Developer Utilities

Wilcoxon signed-rank test calculator

The Wilcoxon signed-rank test calculator compares two paired numeric samples without requiring their differences to follow a normal distribution.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

It ranks the magnitudes of nonzero pair differences, restores their signs, and reports the smaller signed-rank sum as the test statistic. You also receive a two-sided approximate p-value, the positive and negative rank sums, and counts of used and zero-difference pairs, making the result easy to inspect and reproduce. The calculation is deterministic and requires no network access.

When the signed-rank test is the right comparison

Use the Wilcoxon signed-rank test when every value in the first array has a meaningful partner in the second array. Typical pairings include measurements from the same participant before and after an intervention, readings from two instruments applied to the same specimens, or matched observations collected under two conditions. The method tests whether the distribution of paired differences is centered at zero and is commonly interpreted as a test of the median difference when that distribution is reasonably symmetric. It does not treat the arrays as independent samples. Their order therefore matters: the value at each position in <code>x</code> is compared only with the value at the same position in <code>y</code>. Both arrays must contain finite numbers and must have exactly the same length. If observations are unrelated, an independent-samples procedure is more appropriate. If the paired differences are strongly asymmetric, consider the sign test or report the paired differences directly alongside this result rather than relying on a median interpretation alone.

How ranks, ties, zeros, and the p-value are calculated

For each pair, the calculator subtracts <code>y</code> from <code>x</code>. Exact zero differences are removed because they provide no positive or negative evidence. The remaining absolute differences are sorted from smallest to largest and assigned ranks beginning at one. When several absolute differences tie, each receives the average of the ranks that the tied group occupies. The original signs are then restored and ranks are summed separately for positive and negative differences. The reported Wilcoxon statistic is the smaller of those two rank sums, which is the standard two-sided convention. The approximate p-value comes from a normal approximation to the rank-sum distribution. Its variance is adjusted for tied absolute differences, and a continuity correction of one half is applied before the two-sided tail probability is calculated. Because this is an approximation rather than an exact permutation calculation, very small samples should be interpreted cautiously, especially when many differences are tied or equal to zero.

Reading and reporting the result responsibly

A small p-value indicates that rank mass is unusually concentrated on one side of zero under the null model, but it does not measure practical importance. Read <code>positive_rank_sum</code> and <code>negative_rank_sum</code> to see the direction of the observed shift: positive ranks correspond to pairs where <code>x</code> exceeds <code>y</code>, while negative ranks correspond to the reverse. The <code>nonzero_pairs</code> field states the effective sample size used by the test, and <code>zero_differences</code> shows how much data was excluded from ranking. Report the statistic, approximate two-sided p-value, effective sample size, and the direction convention together. It is also good practice to report a paired effect estimate, such as the median of the pairwise differences, with an interval or a clear descriptive summary. Statistical significance should not replace subject-matter judgment, study design review, or correction for multiple testing when many hypotheses are examined. The browser calculation is free; an automated API request uses the displayed base price of $0.002.

Evaluate before-and-after measurements

Compare paired baseline and follow-up values when a normal model for the differences is not a comfortable assumption.

Compare matched instruments

Test whether measurements from two devices applied to the same specimens show a systematic signed shift.

Analyze repeated ratings

Compare two conditions rated by the same people while preserving the participant-level pairing.

What hypothesis does this calculator test?

It performs a two-sided test that the paired-difference distribution is centered at zero. Interpreting this specifically as a median test assumes a reasonably symmetric difference distribution.

What happens when the arrays have different lengths?

The request fails with an invalid-input error because each observation must have exactly one partner.

How are zero differences handled?

Pairs with an exact difference of zero are excluded from ranking and counted in zero_differences.

How are tied absolute differences ranked?

Every member of a tie receives the average of the rank positions occupied by that tie, and the p-value variance is adjusted for ties.

Is the p-value exact?

No. It is a two-sided normal approximation with tie-adjusted variance and a continuity correction, so small effective samples require caution.

How much does an API calculation cost?

Each API request uses the base price $0.002. The same deterministic calculation can run free in the browser.

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/wilcoxon-signed-rank

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/wilcoxon-signed-rank \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"x":[12,15,14,10,18,20],"y":[10,14,15,8,17,16]}'
{
  "x": [
    12,
    15,
    14,
    10,
    18,
    20
  ],
  "y": [
    10,
    14,
    15,
    8,
    17,
    16
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.wilcoxon_signed_rank",
  "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_items10000
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 →