By Waqar Ghouri, founder of CalcMega · Last verified 23 November 2026
A sign test is a nonparametric test of a median that counts plus and minus signs against a hypothesised value, excludes ties, and takes its exact p value from the binomial distribution at probability 0.5.
On the example loaded when the page opens, 12 readings tested against a median of 14 give 9 plus signs and 3 minus signs, an exact two-sided p value of 0.1460, and a median interval from 13 to 20 at 96.14 percent achieved coverage. A split this lopsided would turn up about one time in seven if the true median really were 14, so the readings do not move the median off 14.
The two-sided exact p value at a few common splits:
| Plus signs | Minus signs | Non-tied values | Two-sided exact p value |
|---|---|---|---|
| 5 | 0 | 5 | 0.0625 |
| 8 | 2 | 10 | 0.1094 |
| 7 | 3 | 10 | 0.3438 |
| 9 | 3 | 12 | 0.1460 |
| 10 | 2 | 12 | 0.0386 |
| 12 | 3 | 15 | 0.0352 |
| 15 | 5 | 20 | 0.0414 |
This is the only sign test calculator in the ranking field that takes raw values, paired values and plus and minus counts on one page. The other ranking tools take one or two of the three, and none takes all three.
Worked example: 9 plus signs and 3 minus signs give an exact two-sided p value of 0.1460
The values loaded when the page opens are this example, so the result block above already shows it. Twelve readings are tested against a median of 14. Nine sit above 14 and three sit below it, and none lands exactly on it, so the tie count is zero and n-star is 12. The exact two-sided p value is 0.1460. Read plainly, a split at least this lopsided would turn up about one time in seven if the true median really were 14, so these readings alone do not push the median off 14.
The interval tells the same story from the other side. The order statistic interval from 13 to 20 holds the value 14 comfortably inside it, and its achieved coverage is 96.14 percent. The wider interval from 12 to 21 achieves 99.37 percent. Both figures are printed with the coverage they actually achieve, because a sample of 12 offers only a handful of rank pairs and none of them lands on a round 95 percent.
The paired check: differences of 3, 4, -3, 6 and 2 give a two-sided p value of 0.375
Pair the readings instead and the same engine does the counting on differences. Differences of 3, 4, -3, 6 and 2 give four plus signs and one minus sign, with no zero differences, so n-star is 5 and the two-sided p value is 0.375. Try it in the paired mode above: put any five starting values in the before box and values 3, 4, -3, 6 and 2 higher or lower in the after box, pair by pair. Small samples like this one rarely reach small p values, and the sign test is honest about that rather than dressing the result up.
What is a sign test?
A sign test is a nonparametric test of a median that counts plus and minus signs against a hypothesised value, excludes ties, and takes its exact p value from the binomial distribution at probability 0.5. The method is set out in the NIST Dataplot sign test reference.
That deliberately narrow focus is the whole appeal. A clinic weighing patients before and after a programme, or a workshop timing a job before and after a tool change, often has a dozen pairs, a skewed spread, and no good reason to trust a normality assumption. The sign test asks only whether the values lean one way. The signed rank test goes further and ranks the sizes of the differences as well, which buys power when those sizes are trustworthy and costs robustness when they are not. A t test goes further still and works on the mean. Pick the sign test when direction is the part of the data you trust.
How is the exact sign test p value calculated, and how are ties handled?
Under the null hypothesis the hypothesised median is correct, so each non-tied value is a plus or a minus with probability one half, like a fair coin. The plus count then follows a binomial distribution, and the p value is a tail probability from that distribution, computed exactly. The one-sided greater p value is the probability of at least as many plus signs as the count you saw. The two-sided value doubles the smaller of the two tails, and because doubling can overshoot on balanced counts, it is capped at 1.0000, the largest value a probability can take.
Nothing here is approximated. A normal approximation to the same 9 and 3 split gives 0.1489, close to the exact 0.1460 but not the same number, and on smaller samples the gap widens. This page prints the exact binomial value in every mode, including the counts mode, so a hand count checked against a textbook table will match digit for digit.
The ties case: 2 plus signs and 2 minus signs give a capped two-sided p value of 1.0000
Enter 2 plus signs and 2 minus signs in the counts mode and the two-sided p value comes out at exactly 1.0000. The split is as balanced as a split can be, so the data carry no evidence either way. The uncapped doubling formula would produce a number above 1 on these counts, which no probability may do, so the calculator caps the result at 1.0000 and the step lines say so. Ties behave the same way in every mode: a value equal to the hypothesised median, or a paired difference of zero, is counted, reported in the tie field, and then left out of n-star before any p value is worked out.
How does the distribution free confidence interval for the median work?
This calculator computes an exact sign test with a distribution free confidence interval for the median, printed with its achieved coverage. The construction is simple enough to check by hand. Sort the sample, then take two values at matching ranks in from each end: the third smallest and the third largest, say. For the true median to fall outside that pair, almost every value would have to land on one side of it, and the binomial distribution prices exactly that event. The coverage of the interval is one minus twice that tail probability.
Because the ranks come in whole steps, the coverage comes in steps too. On the worked example the rank pair 3 in from each end gives the interval from 13 to 20 at 96.14 percent, and the next pair out gives 12 to 21 at 99.37 percent. There is no rank pair that gives exactly 95 percent on a sample of 12, which is why this page prints the achieved figure beside every interval instead of stamping a nominal level on it. In paired mode the same construction runs on the paired differences and intervals the median difference. In counts mode there are no values to sort, so no interval is printed, and the result block says why.
The narrowest interval that reaches a 95 percent target at each sample size, and the coverage it really achieves:
| Sample size | Ranks in from each end | Coverage achieved |
|---|---|---|
| 8 | 1 | 99.22 percent |
| 10 | 2 | 97.85 percent |
| 12 | 3 | 96.14 percent |
| 15 | 4 | 96.48 percent |
| 20 | 6 | 95.86 percent |
| 25 | 8 | 95.67 percent |
| 30 | 10 | 95.72 percent |
What this calculator does not cover
The sign test uses direction only, so it says nothing about how large the differences are. A treatment that helps every patient by a tiny amount and a treatment that helps every patient by a large amount give the same p value here. When the sizes of the differences are trustworthy, a signed-rank test or a paired t test uses that information and has more power.
Small samples have a hard floor. With five signs the smallest two-sided p value possible is 0.0625, so no five-sign test can clear the usual 0.05 line whatever the data say. Six unanimous signs are the first split that can, at 0.0313.
Counts mode gives no median interval, because counts alone carry no values to sort. The paired and one-sample forms cover one sample or one set of pairs only. Two independent groups need a different test, and a median interval for a difference between independent groups is not a sign test at all. When every value ties, n-star is zero and there is no test to run: the calculator reports the all-ties case and prints no p value.
Sign Test Calculator FAQs
What is a sign test?
A sign test is a nonparametric test of a median, or of the median of paired differences, that uses only the signs of the differences from the hypothesised value and ignores their magnitudes. Values above the hypothesised median count as plus signs, values below count as minus signs, and exact ties are reported and then excluded. Under the null hypothesis the plus count follows a binomial distribution with probability 0.5.
How is the sign test p value calculated?
Count the plus signs and the minus signs, set n-star to their sum, and take the exact binomial tail probability at probability 0.5. The two-sided p value is twice the smaller tail, capped at 1.0000. On the worked example, 9 plus signs and 3 minus signs in 12 non-tied values give a two-sided p value of 0.1460 and a one-sided greater p value of 0.0730. This calculator prints the exact value, not a normal approximation: the approximation on the same counts gives 0.1489.
What confidence interval does this calculator give for the median?
A distribution free interval built from order statistics: the sorted sample values at symmetric ranks. Because only discrete ranks exist, the interval achieves a specific coverage rather than a round nominal level, and this calculator prints that achieved coverage beside the interval. On the worked example the interval from 13 to 20 achieves 96.14 percent coverage, and the wider interval from 12 to 21 achieves 99.37 percent.
How are ties handled in a sign test?
Ties, values exactly equal to the hypothesised median or paired differences of exactly zero, are counted and reported, then excluded from n-star before any p value is computed. With 2 plus signs and 2 minus signs the two-sided p value is 1.0000: the doubled tail formula would give a value above 1, so the result is capped at 1.0000, the largest value a probability can take.
What does the worked example on this page give?
Data 15, 16, 18, 20, 12, 17, 19, 21, 13, 22, 16, 9 tested against a median of 14 gives 9 plus signs, 3 minus signs and no ties, an exact two-sided p value of 0.1460, and a median interval from 13 to 20 at 96.14 percent achieved coverage. The paired check, differences of 3, 4, -3, 6 and 2, gives 4 plus signs, 1 minus sign and a two-sided p value of 0.375.
When should I use a sign test instead of a signed rank test or a t test?
Use a sign test when you cannot assume normality and you do not want the result to depend on the sizes of the differences, only on their direction. The signed rank test also ranks the magnitudes of the differences, and a t test works on the mean under stronger assumptions. The sign test needs the fewest assumptions of the three, and in return it uses the least information in the data.
Sources: the classical sign test, Hollander and Wolfe, and the NIST Dataplot reference
The sign test is the classical nonparametric test described in Hollander and Wolfe, Nonparametric Statistical Methods, and set out in the NIST Dataplot sign test reference. The order statistic interval for the median follows the Hollander and Wolfe construction. Every figure on this page was computed from those published methods and checked against hand-worked binomial sums. Sources last verified 23 November 2026.
One habit is worth copying from the sources: report the tie count whenever you report a sign test. A result built on 9 plus signs and 3 minus signs out of 12 readings is a different claim from the same counts drawn from 30 readings with 18 ties, and the second figure is the one that tells a reader which situation they are in.