Sign Test Calculator

StatisticsLast updated: August 22, 2026

The sign test is the simplest of the nonparametric tests: it looks only at the sign of the difference between two paired measurements and ignores its magnitude entirely. The null hypothesis states that positive and negative differences are equally likely (P = 0.5), and the p-value is computed EXACTLY from the Binomial(n; 0.5) distribution, with no approximation involved.

Because it does not use the size of the differences, it is less powerful than the Wilcoxon signed-rank test; in exchange it requires no symmetry assumption at all and is completely unaffected by extreme values. This calculator reports the number of plus, minus, and zero (tied) differences, the statistic S = min(plus, minus), the exact two-tailed binomial p-value, a continuity-corrected normal approximation for comparison, a distribution-free confidence interval for the median difference, a sign table, and bar charts.

In paired mode the differences are formed by subtracting measurement 1 from measurement 2; in one-sample mode the hypothesized median is subtracted from every value.
Each value belongs to one subject; the order must match the same person in both measurements.
Enter the same number of values as in measurement 1.
Sets the false positive risk. In the social sciences 5% is the common choice.

Sign Test Formulas

Differences:      dᵢ = xᵢ − yᵢ  (pairs with dᵢ = 0 are dropped)
Effective n:      n = (number of plus) + (number of minus)
Test statistic:   S = min(plus, minus)
Null hypothesis:  H₀: P(d > 0) = P(d < 0) = 0.5
EXACT p-value:    p = 2 · P(X ≤ S) ,  X ~ Binomial(n; 0.5)
Binomial mass:    P(X = i) = C(n, i) · 0.5ⁿ
Normal approx.:   z = (|plus − n/2| − 0.5) / (√n / 2)
Median interval:  [ d₍ₖ₎ , d₍ₙ₊₁₋ₖ₎ ] ,  P(X ≤ k − 1) ≤ α/2

Because the Binomial(n; 0.5) distribution is symmetric, the two-tailed p is obtained EXACTLY by doubling the one-tailed probability; no approximation is used. The normal approximation is given only for comparison and converges to the exact value around n ≥ 25. Dropping the zero differences is standard practice.

How to Calculate

  1. Choose the comparison type: paired mode for two measurements on the same subjects, one-sample mode to compare a single data set against a median value.
  2. In paired mode, enter the two measurements in the same order with an equal number of values; in one-sample mode, enter the data set and the median (M₀) to be tested.
  3. Set the significance level (α); the critical S value and the median confidence interval are computed at that level.
  4. Read the plus, minus, and zero counts; zero differences are excluded from the test and shrink the effective sample.
  5. Base your decision on the EXACT binomial p-value; the normal approximation row is only for comparison and is misleading in small samples.
  6. If the differences are symmetric around their median, run the same data through the Wilcoxon signed-rank test as well: because it uses the size of the differences, it gives a more powerful result.

Worked Examples

Pain score before and after treatment

In 14 of the 15 patients the pain score dropped and in 1 it stayed the same; once the zero difference is dropped, the effective n = 14 and S = 0. The exact binomial p = 2·0.5¹⁴ = 0.000122, so the decrease is statistically significant. The median of the differences is −3.00 and the 95% confidence interval for the median difference runs from −4 to −1; the critical value for α = 0.05 is S ≤ 2.

S test statistic: 0 · Number of plus signs: 0 · Number of minus signs: 14

No difference between two measurement methods

Of the 12 pairs, 6 increased and 6 decreased; with S = 6 and an exact binomial p = 1.000 there is no systematic difference between the two methods. The proportion of positive differences is exactly 50%. This example shows the logic of the sign test clearly: only the directions of the differences are counted, never their magnitudes.

S test statistic: 6 · Number of plus signs: 6 · Number of minus signs: 6

One sample — is the median different from 50?

Of the 12 observations, 8 lie above 50 and 4 below; S = 4 and the exact binomial p = 0.388. There is no basis for concluding that the median differs from 50. Even though the proportion of positive differences is 66.7%, 12 observations are not enough to make that departure significant — the low power of the sign test is plain to see here.

S test statistic: 4 · Number of plus signs: 8 · Number of minus signs: 4

Frequently Asked Questions

What is the difference between the sign test and the Wilcoxon signed-rank test?
The sign test only counts the direction of the differences, whereas Wilcoxon ranks the magnitudes of the differences and sums those ranks. Wilcoxon therefore usually produces a smaller p-value on the same data, meaning it is more powerful. In exchange, Wilcoxon assumes the differences are symmetric around their median; the sign test makes no distributional assumption at all.
Why is the p-value described as 'exact'?
Under the null hypothesis the number of plus signs follows a Binomial(n; 0.5) distribution, and that distribution can be evaluated exactly; no normal or chi-square approximation is needed. This calculator produces the p-value by summing the C(n, i)·0.5ⁿ terms, so the result is exact no matter how small n is. The p from the normal approximation is shown for comparison only.
What happens to zero differences (ties)?
Pairs whose two measurements are exactly equal are excluded from the test and the effective n falls accordingly; this is the standard practice for the sign test. A large number of ties reduces the power of the test considerably and usually signals that the measurement is not precise enough. Methods such as randomly assigning ties to plus or minus are not recommended.
When should I use the sign test?
The sign test is the right choice when the differences are heavily skewed, when extreme values are present, when the measurement can only be recorded as 'better / worse', and when a symmetry assumption cannot be defended. It is also the most robust way to test a hypothesis about a median. When the data allows it, Wilcoxon or the paired t-test is preferred because they are more powerful.
How do I get the same result in SPSS and R?
In SPSS, go to Analyze → Nonparametric Tests → Related Samples and select 'Sign'; the exact binomial p is reported for small samples and the normal approximation for large ones. In R, binom.test(number_of_plus, n, 0.5) produces exactly the same p-value, while the SIGN.test function of the BSDA package also returns the median confidence interval. In Excel, the formula 2*BINOM.DIST(S; n; 0.5; TRUE) gives the same result.
How is the median confidence interval built?
The order statistics in positions k and (n+1−k) of the sorted differences are taken as the bounds, where k is the largest value whose lower-tail probability in the Binomial(n; 0.5) distribution does not exceed α/2. Because the binomial distribution is discrete, the actual coverage probability comes out slightly above the targeted level, and the calculator reports it separately. If the number of observations is very small, no interval can be built at the requested level.
What is being tested in one-sample mode?
The hypothesized median M₀ is subtracted from every observation and the signs of the resulting differences are counted, which tests the hypothesis that the population median equals M₀. This is the nonparametric counterpart of the one-sample t-test, working on the median instead of the mean. Since it requires no normality assumption, it suits skewed variables such as income, duration, and cost.