If opponent all out, enter full quota (e.g., 20 or 50)
Runs Per Over (For):0.00
Runs Per Over (Against):0.00
+0.000
function calculateNRR() {
// 1. Get Input Values
var runsScored = document.getElementById("runsScored").value;
var oversFaced = document.getElementById("oversFaced").value;
var runsConceded = document.getElementById("runsConceded").value;
var oversBowled = document.getElementById("oversBowled").value;
// 2. Validate Inputs
if (runsScored === "" || oversFaced === "" || runsConceded === "" || oversBowled === "") {
alert("Please fill in all fields to calculate Net Run Rate.");
return;
}
// 3. Helper function to convert cricket overs (e.g. 10.4) to actual decimal overs (10.666)
function parseOvers(val) {
var strVal = val.toString();
var parts = strVal.split('.');
var overs = parseInt(parts[0]);
var balls = 0;
if (parts.length > 1) {
balls = parseInt(parts[1]);
// Handle cases where user might type 10.10 (which is invalid in cricket, but logic handles single digits)
// In cricket 10.1 is 1 ball, 10.6 is invalid (becomes next over).
if (parts[1].length === 1 && balls > 6) {
alert("Invalid ball count entered in overs (cannot be > 6).");
return null;
}
}
if (balls >= 6) {
// If user enters 19.6, strictly that is 20 overs.
overs += Math.floor(balls / 6);
balls = balls % 6;
}
return overs + (balls / 6);
}
var adjOversFaced = parseOvers(oversFaced);
var adjOversBowled = parseOvers(oversBowled);
if (adjOversFaced === null || adjOversBowled === null) return;
if (adjOversFaced === 0 || adjOversBowled === 0) {
alert("Overs cannot be zero.");
return;
}
// 4. Calculate Run Rates
// NRR Formula: (Runs Scored / Overs Faced) – (Runs Conceded / Overs Bowled)
var runRateFor = parseFloat(runsScored) / adjOversFaced;
var runRateAgainst = parseFloat(runsConceded) / adjOversBowled;
var nrr = runRateFor – runRateAgainst;
// 5. Display Results
var resultDiv = document.getElementById("result-container");
var rpoForEl = document.getElementById("rpoFor");
var rpoAgainstEl = document.getElementById("rpoAgainst");
var nrrResultEl = document.getElementById("nrrResult");
resultDiv.style.display = "block";
rpoForEl.innerText = runRateFor.toFixed(2);
rpoAgainstEl.innerText = runRateAgainst.toFixed(2);
// Format NRR (Add + sign if positive)
var nrrFormatted = nrr.toFixed(3);
if (nrr > 0) {
nrrFormatted = "+" + nrrFormatted;
nrrResultEl.className = "final-nrr"; // Green color via CSS
} else if (nrr < 0) {
nrrResultEl.className = "final-nrr nrr-negative"; // Red color via CSS
} else {
nrrResultEl.className = "final-nrr";
}
nrrResultEl.innerText = nrrFormatted;
}
How Do You Calculate Net Run Rate (NRR)?
Net Run Rate (NRR) is the preferred statistical method used in professional cricket tournaments—such as the IPL, ICC World Cup, and T20 leagues—to rank teams that finish with equal points. It essentially measures a team's winning margin or losing margin throughout a tournament.
Unlike a simple average, NRR takes into account the volume of overs played, ensuring that teams who score quickly or dismiss opponents cheaply are rewarded.
The Net Run Rate Formula
The calculation for NRR involves two distinct parts: your team's scoring rate and the rate at which your team concedes runs.
NRR = (Total Runs Scored ÷ Total Overs Faced) − (Total Runs Conceded ÷ Total Overs Bowled)
In simpler terms:
Step 1: Calculate your team's average runs per over (Run Rate For).
Step 2: Calculate the opponent's average runs per over against you (Run Rate Against).
Step 3: Subtract the "Run Rate Against" from the "Run Rate For".
Understanding Cricket Overs in Calculations
One of the most confusing aspects of calculating NRR manually is handling partial overs. In cricket, overs are typically written as 10.4 (10 overs and 4 balls). However, mathematically, 4 balls is not 0.4 of an over; it is 4/6ths of an over.
When calculating NRR, you must convert the dot notation into a true fraction:
10.1 overs becomes 10 + 1/6 = 10.166…
10.3 overs becomes 10 + 3/6 = 10.5
10.4 overs becomes 10 + 4/6 = 10.666…
Crucial Rule: The "All Out" Exception
There is a critical rule in the ICC regulations regarding NRR calculation that significantly affects the result: If a team is bowled out (all out) before their full quota of overs is finished, the calculation assumes they faced the full quota.
Example: In a T20 match, if Team A is bowled out for 120 runs in 15.3 overs, the NRR calculation divides 120 by 20.0 (the full quota), not 15.5. This penalizes teams heavily for getting all out.
However, if a team chases down a target in 15.3 overs, the calculation uses the actual overs faced (15.5), rewarding them for a quick victory.
Example Calculation
Let's say Team A has played 1 match in a tournament:
Batting: Scored 180 runs in 20.0 overs.
Bowling: Restricted the opponent to 150 runs in 20.0 overs.
Calculation:
Run Rate For = 180 / 20 = 9.00
Run Rate Against = 150 / 20 = 7.50
NRR = 9.00 – 7.50 = +1.500
A positive NRR indicates you are scoring faster than your opponents on average, while a negative NRR implies your opponents are outscoring you.