Mean Reciprocal Rank Calculator
Calculate the mean reciprocal rank (MRR) from the ranks of the first relevant result per query, a key metric for search and retrieval systems.
Last reviewed by the Radiatus Cloud team
Calculate mean reciprocal rank from the rank of the first relevant result per query.
Securing AI in production?
We build guardrails, governance & compliance for AI systems.
Calculate mean reciprocal rank
Mean reciprocal rank, or MRR, evaluates systems that return a ranked list of results, such as search engines and retrieval components. For each query, you record the rank of the first relevant result, and the reciprocal rank is one divided by that position; MRR is the average of these reciprocal ranks across all queries. A first relevant result at position one contributes one, at position two contributes one half, and so on, so earlier correct results score much higher.
If no relevant result is found for a query, its reciprocal rank is zero, which you indicate by entering a rank of zero.
Where MRR is used
MRR is a favourite metric for question answering, retrieval-augmented generation and any search task where getting one relevant result near the top matters most. Because it only considers the first relevant hit, it rewards systems that rank the right answer highly and is easy to interpret. A higher MRR means relevant results appear earlier on average.
For tasks where many relevant results per query matter, metrics like mean average precision or recall at k complement MRR. All calculation happens locally in your browser.
Related tools
- AI Prompt Leakage Analyzer — Paste a system prompt and a hostile user input to see whether the prompt holds secrets and whether the input carries injection patterns. Local, instant.
- LLM Data Exposure Checker — Check if text contains data likely to be memorized or exposed by LLMs.
- AI Usage Policy Generator — Generate an acceptable use policy for AI tools in your company.
- Model Hallucination Estimator — Estimate risk of hallucinations based on task type and temperature.
Frequently Asked Questions
What is mean reciprocal rank?
It is the average over queries of one divided by the rank of the first relevant result, rewarding systems that rank relevant results highly.
How do I handle a query with no relevant result?
Enter a rank of zero for that query. Its reciprocal rank counts as zero while still being included in the average.
Why only the first relevant result?
MRR focuses on how quickly a system surfaces one relevant result, which is what matters most in question answering and many search tasks.
What complements MRR?
When multiple relevant results per query matter, metrics such as mean average precision or recall at k give a fuller picture.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Enter the rank of the first relevant result for each query, one per line.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
AI Prompt Leakage Analyzer
AI SecurityPaste a system prompt and a hostile user input to see whether the prompt holds secrets and whether the input carries injection patterns. Local, instant.
LLM Data Exposure Checker
AI SecurityCheck if text contains data likely to be memorized or exposed by LLMs.
AI Usage Policy Generator
AI SecurityGenerate an acceptable use policy for AI tools in your company.