Reciprocal Rank Fusion calculator
Merge two ranked lists without mixing their raw scores. Inspect which documents gain support from both lists and how a candidate window changes the result.
Compare two ranked result lists
Calculations run in this page. This tool does not save inputs, send them to a calculation service or put them in the URL. Inputs and results are masked from optional session recording; other page scripts and browser extensions remain outside these guarantees. Use non-sensitive example IDs.
One document ID per line, best first; up to 100 nonblank IDs and 8,192 UTF-16 code units per list. IDs use 1–64 ASCII letters, digits, dot, underscore or hyphen. Case-sensitive; field-edge spaces trimmed, blank lines ignored. Duplicate IDs within a list are errors, including beyond the retained window. No scores, headers or CSV.
Whole decimal integers only. Rank constant: 1–1,000. Candidate window: 1–100 per list. Output size: 1–200. The window is applied before scoring; output size is applied after fusion.
Fusion summary
List A: 3 supplied, 3 retained. List B: 3 supplied, 3 retained.
4 candidate documents · 2 shared candidates · 4 displayed results.
Each retained rank contributes 1/(k + rank). Ranks start at one; absent documents contribute zero. Equal weights. Exact score ties use ascending ASCII document ID.
Fused ranking and contributions
| Position | Document | Rank A | Rank B | A contribution | B contribution | Exact total | Score (8 decimals) |
|---|---|---|---|---|---|---|---|
| 1 | cloud-basics | 2 | 1 | 1/62 | 1/61 | 123/3782 | 0.03252247 |
| 2 | api-guide | 1 | 3 | 1/61 | 1/63 | 124/3843 | 0.03226646 |
| 3 | network-notes | Absent | 2 | 0 (absent) | 1/62 | 1/62 | 0.01612903 |
| 4 | sql-lab | 3 | Absent | 1/63 | 0 (absent) | 1/63 | 0.01587302 |
Displayed decimals are rounded. Sorting uses the exact fractions, so a rounded display tie does not change the order.
Copy the calculation report
Select and copy to retain parameters, all scored candidates and the displayed subset. RRF scores are ranking signals, not probabilities or relevance labels.
Read the sample one contribution at a time
At k = 60, cloud-basics appears at rank 2 in A and rank 1 in B. Its score is 1/62 + 1/61 = 123/3782, approximately 0.03252247. api-guide receives 1/61 + 1/63, approximately 0.03226646. network-notes appears only in B and gets 1/62. sql-lab appears only in A and gets 1/63. The sample demonstrates the calculation; the IDs are invented examples, not measured search results.
Three controls answer different questions
The rank constant k controls the contribution curve. Increasing k reduces the relative advantage of a first-place hit over a lower-ranked hit. It does not request more results. The candidate window retains only the first W IDs from each list before fusion. Output size selects the first N documents after sorting the fused candidates.
Try “Window of one.” Only api-guide from A and cloud-basics from B remain. Each receives 1/61, and the ASCII ID tie-break places api-guide first. Requesting a larger output cannot recover sql-lab or network-notes after they were excluded by the window. Increasing the window and increasing the output size are different experiments.
Identity and duplicate policy are part of the calculation
Use the same stable ID for the same document in both lists. Different IDs are treated as different documents, even if their content is identical. IDs are case-sensitive: Guide and guide are distinct. A document can contribute once from each list. This tool rejects repeated IDs within one list rather than guessing which occurrence you intended; clean the list and rerun.
Blank lines do not consume rank positions. Leading and trailing spaces are removed. Input validation checks the full supplied lists before windowing, so an invalid or duplicated row beyond the window still produces an error. This keeps a smaller window from hiding a malformed input that would fail after you enlarge it.
Exact ties and rounded displays
The calculator adds rational contributions and compares their exact fractions within its bounded integer inputs. A true score tie is resolved by ascending ASCII ID; position is a deterministic display order, not a judgment that one tied document is more relevant. The two-list “Exact tie example” gives A and B identical totals. Decimal values are rounded to eight places only for display.
A fusion score is not a relevance probability
A larger score means more rank-based support under these lists and settings. It does not establish factual correctness, answer quality or a probability that a document is relevant. Adding another list changes the possible score scale; do not compare scores from different retrieval setups as if they were calibrated confidence values.
Candidate lists are finite observations. A missing document contributes zero here because it was not retained, not because its full-corpus relevance was measured as zero. Two similar retrievers can reinforce the same mistake. Use judged queries and retrieval metrics to evaluate whether a change actually helps your task.
Reproduce and evaluate the merge
The RRF Python guide contains a runnable exact-arithmetic reference and discusses integration boundaries. Use the retrieval metrics calculator when you have relevance judgments, or the vector similarity calculator to explore how raw vector scoring differs from rank fusion.
Formula reference: Elastic’s RRF documentation. This is an educational two-list calculation, not an Elasticsearch request builder or engine emulator. It applies the explicit input, window and tie policies described above; engine-specific retrieval, filtering and distributed behavior require separate verification.