Use decimal for balls (e.g., 49.3 is 49 overs, 3 balls)
Team Bowling Performance
Total runs scored by opponents
Use decimal for balls (e.g., 48.5 is 48 overs, 5 balls)
Calculated Net Run Rate
0.000
Formula to Calculate Net Run Rate in Cricket
Net Run Rate (NRR) is the primary method used in cricket tournaments to rank teams with equal points. It acts as a tie-breaker in league tables such as the ICC World Cup, T20 World Cup, IPL, and the Big Bash League. Effectively, it measures a team's winning margin or losing margin relative to the overs played.
The NRR Formula
The calculation involves two separate run rates: the team's batting run rate and the team's bowling run rate. The Net Run Rate is the difference between the two.
NRR = (Total Runs Scored / Total Overs Faced) – (Total Runs Conceded / Total Overs Bowled)
Note on "Total Overs": In cricket, overs are often displayed as decimals (e.g., 10.4). However, for mathematical calculation, 10.4 overs represents 10 overs and 4 balls. Since an over has 6 balls, this must be converted to a true fraction: 10 + (4/6) = 10.666.
How to Handle "All Out" Scenarios
There is a critical rule in calculating NRR: If a team is bowled out (all out) before their full quota of overs is finished, the calculation uses the full quota of overs.
For example, in a T20 match (20 overs), if Team A is bowled out for 140 runs in 18.2 overs, you calculate their run rate as 140 divided by 20, not 140 divided by 18.33.
Example Calculation
Scenario: Team X plays 2 matches in a tournament.
Match 1: Scored 180/6 in 20 overs. Conceded 160/8 in 20 overs.
Match 2: Scored 150/10 in 18 overs (All Out). Conceded 140/9 in 20 overs.
Step 1: Calculate Totals
Total Runs Scored: 180 + 150 = 330
Total Overs Faced: 20 + 20 (adjusted because they were all out in Match 2) = 40
Total Runs Conceded: 160 + 140 = 300
Total Overs Bowled: 20 + 20 = 40
Step 2: Apply Formula
Batting Rate: 330 / 40 = 8.25
Bowling Rate: 300 / 40 = 7.50
NRR: 8.25 – 7.50 = +0.750
Why is NRR Negative?
A negative Net Run Rate implies that, on average, a team is scoring runs slower than they are conceding them. To improve a negative NRR, a team must win matches by large margins (either by runs or by chasing a target quickly with many overs to spare).
function calculateCricketNRR() {
// Get input values
var runsScoredInput = document.getElementById('nrr-runs-scored').value;
var oversFacedInput = document.getElementById('nrr-overs-faced').value;
var runsConcededInput = document.getElementById('nrr-runs-conceded').value;
var oversBowledInput = document.getElementById('nrr-overs-bowled').value;
// Validation: Check if inputs are filled
if (runsScoredInput === " || oversFacedInput === " || runsConcededInput === " || oversBowledInput === ") {
alert("Please fill in all fields (Runs Scored, Overs Faced, Runs Conceded, Overs Bowled).");
return;
}
var runsScored = parseFloat(runsScoredInput);
var oversFacedRaw = parseFloat(oversFacedInput);
var runsConceded = parseFloat(runsConcededInput);
var oversBowledRaw = parseFloat(oversBowledInput);
// Validation: Negative numbers
if (runsScored < 0 || oversFacedRaw < 0 || runsConceded < 0 || oversBowledRaw 19 and 0.5. (0.5 * 10) = 5 balls.
var decimalPart = Math.round((oversVal – fullOvers) * 10);
// Validation for ball count (cannot be >= 6)
if (decimalPart >= 6) {
// If user enters 10.6, treat as 11 overs technically, but strictly in cricket .6 isn't used
// We will just process mathematically, but usually input is .0 to .5
}
var ballsAsFraction = decimalPart / 6;
return fullOvers + ballsAsFraction;
}
var realOversFaced = convertOversToDecimal(oversFacedRaw);
var realOversBowled = convertOversToDecimal(oversBowledRaw);
// Prevent division by zero
if (realOversFaced === 0 || realOversBowled === 0) {
alert("Overs faced or bowled cannot be zero.");
return;
}
// Calculate Run Rates
var battingRunRate = runsScored / realOversFaced;
var bowlingRunRate = runsConceded / realOversBowled;
// Calculate NRR
var netRunRate = battingRunRate – bowlingRunRate;
// Display Results
var resultDiv = document.getElementById('nrr-result-display');
var valueDiv = document.getElementById('nrr-final-value');
var summaryDiv = document.getElementById('nrr-summary');
// Format NRR to 3 decimal places (standard in cricket)
var formattedNRR = netRunRate.toFixed(3);
// Add + sign for positive numbers
if (netRunRate > 0) {
formattedNRR = "+" + formattedNRR;
valueDiv.style.color = "#2e7d32"; // Green
} else if (netRunRate < 0) {
valueDiv.style.color = "#c62828"; // Red
} else {
valueDiv.style.color = "#333";
}
valueDiv.innerHTML = formattedNRR;
summaryDiv.innerHTML =
"Breakdown:" +
"Batting Run Rate: " + battingRunRate.toFixed(3) + " (Runs/Over)" +
"Bowling Run Rate: " + bowlingRunRate.toFixed(3) + " (Runs/Over)" +
"Formula: " + battingRunRate.toFixed(3) + " – " + bowlingRunRate.toFixed(3) + " = " + formattedNRR + "";
resultDiv.style.display = 'block';
}