Mean Reciprocal Rank (MRR) Calculator
Paste the first-hit rank of each query, or a 0/1 relevance list per query, and get MRR with every reciprocal rank and the full arithmetic shown. The standard information-retrieval / TREC definition. No signup, nothing uploaded.
How it works
Mean Reciprocal Rank (MRR) measures how high up a ranked list the firstrelevant result appears, averaged over a set of queries. It is the headline metric for tasks that have one correct answer to find quickly — question answering, known-item search, entity lookup, and the retrieval step of a RAG pipeline. The definition here follows Voorhees (1999), who introduced MRR as the official score of the TREC-8 Question Answering track, and Manning, Raghavan & Schütze, §8.
Positions are 1-indexed. For each query i, let rankᵢ be the position of the first relevant result. The score is built in three steps:
- Reciprocal rank. Take
RRᵢ = 1 / rankᵢ. A first hit at rank 1 scores 1, rank 2 scores 0.5, rank 3 scores about 0.333 — the reward drops off quickly as the first relevant result sinks lower. - No-hit convention. If a query returns no relevant result at all,
RRᵢ = 0(Voorhees, 1999). The query still counts toward Q, so misses pull the average down rather than being ignored. - Average. Add the reciprocal ranks and divide by the number of queries:
MRR = (1/Q) · Σᵢ 1/rankᵢ, a value in [0, 1].
The two input modes are equivalent. In ranks mode you type the position directly. In relevance-list mode you give a 0/1 list per query and the tool finds the first 1 from the left, so 0, 0, 1 is read as rank 3, identical to typing 3; an all-zero line is a no-hit. Because MRR depends only on the first relevant position, anything below it is irrelevant to the score — that is exactly the difference from NDCG, which grades and discounts the whole list. As a credibility check, the calculator computes the average a second way — summing the reciprocal ranks smallest-first rather than in input order — and confirms the two routes agree to floating-point precision. Everything is deterministic and runs entirely in your browser.
Worked examples
Frequently asked questions
Sources & references
- Manning, Raghavan & Schütze — Introduction to Information Retrieval, §8 Evaluation in information retrieval (Cambridge / Stanford NLP)
- E. M. Voorhees (1999) — The TREC-8 Question Answering Track Report (NIST): origin of MRR and the no-relevant-result ⇒ 0 convention
- Wikipedia — Mean reciprocal rank: cross-check of the formula and notation
The formula on this page was last cross-checked against these sources on 2026-06-10. MRR is a stable mathematical definition, so this tool needs no rate or schedule updates — only the worked examples are periodically re-reconciled.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.