Replaces the values with their ranks before measuring correlation. It picks up any tendency for one variable to rise with the other even when the relationship is not a straight line, and it is far less disturbed by outliers.
The ordinary correlation coefficient, Pearson's, measures how well two variables line up along a straight line. So even when one variable rises reliably with the other, a curved rise pulls the coefficient down.
Spearman's rank correlation replaces the values with their ranks first. Ranking throws away how steeply something rises and keeps only whether it rises at all.
It is simply Pearson's coefficient applied to the ranks, and it lives in the same range, from −1 to 1.
When values tie, every tied value receives the average of the ranks they jointly occupy. In 1, 2, 2, 3 the two 2s share second and third place, so both are ranked 2.5. Assigning them 2 and 3 in sequence would change the spread of the ranks and shift the coefficient.
Take the defaults x = 10, 20, 30, 40, 50 and y = 3, 5, 12, 40, 200.
y rises every time x rises, but it rises ever faster. From 3 to 5 is a gain of 2; from 40 to 200 is a gain of 160.
Ranked, x becomes 1, 2, 3, 4, 5 and y becomes 1, 2, 3, 4, 5 as well. They match perfectly, so the rank correlation is exactly 1.
Pearson's coefficient, meanwhile, is about 0.8070. The value of 200 sits far off any straight line, holding it back. The gap between the two numbers is exactly the difference between the two methods: perfect on ordering, merely good on straightness.
It suits data with outliers. Ranks ignore distance, so one wildly large value simply becomes the largest rank rather than dominating the arithmetic.
It also suits data that arrives as ranks already, such as preference orderings in a survey, or how closely two contest judges agreed on their placings.
Because it only registers rising or falling, it misses hump-shaped relationships. Something that rises and then falls produces ranks whose agreement cancels out, pushing the coefficient towards 0.
Ranking discards information. When the relationship really is linear, Pearson's coefficient keeps more of it. Rather than choosing one, it is usually more informative to compute both and pay attention to where they disagree.