body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background-color: #f4f7f6;
}
.calculator-container {
background: #ffffff;
padding: 30px;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
max-width: 600px;
margin: 0 auto 40px auto;
border-top: 5px solid #005f6b;
}
.calculator-title {
text-align: center;
color: #005f6b;
margin-bottom: 25px;
font-size: 24px;
font-weight: 700;
}
.input-group {
margin-bottom: 20px;
}
.input-group label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #2c3e50;
}
.input-group input {
width: 100%;
padding: 12px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 16px;
box-sizing: border-box;
transition: border-color 0.3s;
}
.input-group input:focus {
border-color: #005f6b;
outline: none;
}
.helper-text {
font-size: 12px;
color: #666;
margin-top: 5px;
}
.btn-calc {
display: block;
width: 100%;
padding: 15px;
background-color: #005f6b;
color: white;
border: none;
border-radius: 6px;
font-size: 18px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s;
}
.btn-calc:hover {
background-color: #004852;
}
.result-box {
margin-top: 25px;
padding: 20px;
background-color: #f8f9fa;
border-radius: 8px;
text-align: center;
border: 1px solid #e9ecef;
display: none;
}
.nrr-value {
font-size: 36px;
font-weight: 800;
margin: 10px 0;
}
.positive {
color: #27ae60;
}
.negative {
color: #c0392b;
}
.breakdown {
margin-top: 15px;
font-size: 14px;
color: #555;
text-align: left;
border-top: 1px solid #ddd;
padding-top: 10px;
}
.content-section {
background: white;
padding: 40px;
border-radius: 12px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
margin-top: 40px;
}
h2 {
color: #005f6b;
border-bottom: 2px solid #f0f0f0;
padding-bottom: 10px;
margin-top: 30px;
}
h3 {
color: #2c3e50;
margin-top: 25px;
}
p {
margin-bottom: 15px;
}
ul, ol {
margin-bottom: 20px;
padding-left: 25px;
}
li {
margin-bottom: 8px;
}
.formula-box {
background-color: #eef2f5;
padding: 15px;
border-left: 4px solid #005f6b;
font-family: "Courier New", monospace;
margin: 20px 0;
}
@media (max-width: 600px) {
.calculator-container, .content-section {
padding: 20px;
}
}
function calculateNRR() {
var runsScored = parseFloat(document.getElementById('runsScored').value);
var oversFaced = parseFloat(document.getElementById('oversFaced').value);
var runsConceded = parseFloat(document.getElementById('runsConceded').value);
var oversBowled = parseFloat(document.getElementById('oversBowled').value);
if (isNaN(runsScored) || isNaN(oversFaced) || isNaN(runsConceded) || isNaN(oversBowled)) {
alert("Please enter valid numbers for all fields.");
return;
}
// Helper function to convert cricket overs (e.g. 10.4) to decimal overs (e.g. 10.666)
function getActualOvers(oversInput) {
var wholeOvers = Math.floor(oversInput);
var balls = Math.round((oversInput – wholeOvers) * 10);
// Validation: Balls cannot be >= 6 in cricket notation
if (balls >= 6) {
// If user enters 10.6, treat it as 11.0?
// Or simply calculate strictly. Let's assume standard .1 to .5 inputs.
// However, let's normalize just in case.
wholeOvers += Math.floor(balls / 6);
balls = balls % 6;
}
return wholeOvers + (balls / 6);
}
var actualOversFaced = getActualOvers(oversFaced);
var actualOversBowled = getActualOvers(oversBowled);
if (actualOversFaced === 0 || actualOversBowled === 0) {
alert("Overs cannot be zero.");
return;
}
var runRateFor = runsScored / actualOversFaced;
var runRateAgainst = runsConceded / actualOversBowled;
var nrr = runRateFor – runRateAgainst;
var resultBox = document.getElementById('resultBox');
var nrrDisplay = document.getElementById('nrrDisplay');
var breakdown = document.getElementById('calcBreakdown');
resultBox.style.display = 'block';
// Formatting NRR to 3 decimal places
var formattedNRR = nrr.toFixed(3);
if (nrr > 0) formattedNRR = "+" + formattedNRR;
nrrDisplay.innerHTML = formattedNRR;
if (nrr >= 0) {
nrrDisplay.className = "nrr-value positive";
} else {
nrrDisplay.className = "nrr-value negative";
}
breakdown.innerHTML =
"
" +
"Run Rate For: " + runsScored + " / " + actualOversFaced.toFixed(4) + " = " + runRateFor.toFixed(4) + "" +
"Run Rate Against: " + runsConceded + " / " + actualOversBowled.toFixed(4) + " = " + runRateAgainst.toFixed(4) + "" +
"NRR = " + runRateFor.toFixed(4) + " – " + runRateAgainst.toFixed(4) + " = " + formattedNRR;
}
Understanding the ICC Net Run Rate (NRR)
In the high-stakes world of cricket tournaments like the ICC World Cup, the T20 World Cup, and major leagues like the IPL or Big Bash, points tables often end in a deadlock. When two or more teams finish with the same number of points, the Net Run Rate (NRR) becomes the decisive tie-breaker that determines who advances to the semi-finals and who goes home.
This Net Run Rate Calculator is designed to help analysts, fans, and team strategists quickly determine the NRR based on runs scored, overs faced, runs conceded, and overs bowled.
How is Net Run Rate Calculated?
The concept of Net Run Rate is essentially a measure of a team's winning margin or losing margin throughout a tournament. It is calculated by subtracting the "Run Rate Conceded" from the "Run Rate Scored".
NRR Formula:
NRR = (Total Runs Scored ÷ Total Overs Faced) – (Total Runs Conceded ÷ Total Overs Bowled)
Key Components:
- Total Runs Scored: The sum of all runs the team has scored in all matches in the group stage.
- Total Overs Faced: The sum of all overs the team has batted. Important: If a team is "All Out" before their full quota of overs (e.g., in 35 overs in a 50-over match), the calculation counts the full quota (50 overs) as faced.
- Total Runs Conceded: The sum of all runs scored by opponents against the team.
- Total Overs Bowled: The sum of all overs the team has bowled. Similarly, if the team bowls the opponent out, the full quota of overs is used for the divisor.
Step-by-Step Calculation Example
Let's pretend "Team Alpha" has played 2 matches in a T20 tournament.
- Match 1: Team Alpha scores 180/6 in 20 overs. They restrict the opponent to 160/9 in 20 overs.
- Match 2: Team Alpha scores 150/10 (All Out) in 18.2 overs. However, because they were all out, the NRR calculation charges them for the full 20 overs. The opponent chases it down, scoring 152/4 in 17.3 overs.
Step 1: Calculate Total Runs For and Overs Faced
Runs For = 180 (Match 1) + 150 (Match 2) = 330 Runs.
Overs Faced = 20.0 (Match 1) + 20.0 (Match 2, adjusted because All Out) = 40.0 Overs.
Run Rate For = 330 ÷ 40 = 8.25
Step 2: Calculate Total Runs Against and Overs Bowled
Runs Against = 160 (Match 1) + 152 (Match 2) = 312 Runs.
Overs Bowled = 20.0 (Match 1) + 17.5 (Match 2, 17.3 overs = 17 + 3/6 = 17.5 overs) = 37.5 Overs.
Run Rate Against = 312 ÷ 37.5 = 8.32
Step 3: Final NRR
NRR = 8.25 – 8.32 = -0.070
Why Inputs for "Balls" Matter
In cricket, overs are denoted as X.Y, where Y is the number of balls (1 to 6). Mathematically, 10.3 overs does not equal 10.3 in decimal. It equals 10 and 3/6ths of an over, or 10.5. Our calculator automatically handles this conversion to ensure 100% accuracy.
Common Scenarios Affecting NRR
1. Team All Out
If a batting team is bowled out, the overs faced figure used for the NRR calculation is the full quota of overs (e.g., 20 or 50), not the actual overs batted. This penalizes teams for losing all their wickets early.
2. Duckworth-Lewis-Stern (DLS) Method
In rain-affected matches where DLS is applied, the runs scored and overs faced are adjusted to the par scores and revised overs. For NRR purposes, usually, the actual runs and overs (as per the revised targets) are used, but specific tournament rules may vary slightly.
3. Abandoned Matches
Matches that are abandoned without a result usually do not contribute to the Net Run Rate calculation. The runs and overs from these games are excluded entirely.
Tips for Using This Calculator
- Always check the tournament rules regarding "All Out" scenarios. If your team was all out in 15.4 overs in a T20, enter 20.0 in the "Total Overs Faced" field for accurate results.
- Enter overs using the dot notation for balls. For example, enter 4.2 for 4 overs and 2 balls.
- A positive NRR means your team scores faster than they concede, while a negative NRR implies the opposite.