Cricket Run Rate Calculation App

Cricket Run Rate Calculator .cricket-calculator-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 800px; margin: 20px auto; padding: 30px; background-color: #f9fff9; border: 1px solid #d4edda; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); } .cricket-calculator-container h2 { color: #155724; text-align: center; margin-bottom: 25px; } .cricket-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } @media (max-width: 600px) { .cricket-calc-grid { grid-template-columns: 1fr; } } .cricket-form-group { margin-bottom: 15px; } .cricket-form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #333; } .cricket-form-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; box-sizing: border-box; } .cricket-form-group input:focus { border-color: #28a745; outline: none; } .calc-btn { display: block; width: 100%; padding: 15px; background-color: #28a745; color: white; border: none; border-radius: 4px; font-size: 18px; font-weight: bold; cursor: pointer; margin-top: 10px; transition: background 0.3s; } .calc-btn:hover { background-color: #218838; } .results-panel { margin-top: 30px; background-color: #ffffff; border: 1px solid #e9ecef; border-radius: 6px; padding: 20px; display: none; } .main-result { text-align: center; padding-bottom: 15px; border-bottom: 2px solid #28a745; margin-bottom: 15px; } .main-result h3 { margin: 0; color: #555; font-size: 1.1em; } .main-result .result-value { font-size: 2.5em; font-weight: 800; color: #28a745; } .stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; } .stat-box { background: #f8f9fa; padding: 15px; border-radius: 4px; text-align: center; } .stat-label { display: block; font-size: 0.9em; color: #666; margin-bottom: 5px; } .stat-value { font-size: 1.4em; font-weight: bold; color: #333; } .error-msg { color: #dc3545; font-weight: bold; text-align: center; margin-top: 10px; display: none; } .article-content { margin-top: 50px; line-height: 1.6; color: #333; } .article-content h3 { color: #155724; margin-top: 30px; } .article-content ul { background: #fff; padding: 20px 40px; border-radius: 5px; border-left: 4px solid #28a745; } .formula-box { background-color: #e9ecef; padding: 15px; font-family: monospace; border-radius: 4px; margin: 15px 0; }

🏏 Cricket Run Rate Calculator

Current Run Rate (CRR)

0.00
Required Run Rate (RRR)
Projected Score (at Current Rate)
Runs Needed
Balls Remaining

How to Calculate Cricket Run Rates

Whether you are watching a T20 thriller or a classic Test match, understanding the mathematics behind the scoreboard is essential. This calculator handles the logic for converting standard cricket notation (e.g., 10.4 overs) into precise mathematical values to determine the Current Run Rate (CRR) and the Required Run Rate (RRR).

Understanding the Formulas

Calculating run rate isn't as simple as dividing runs by the number on the scoreboard because cricket overs are base-6, not base-10.

1. Current Run Rate (CRR)

The CRR is the average number of runs a batting team scores per over.

CRR = Total Runs Scored / Total Overs Bowled

Note on Calculation: If the overs are 10.4, mathematically this represents 10 overs and 4 balls. Since an over has 6 balls, 4 balls is 4/6 or 0.666 overs. So, 10.4 overs = 10.666 mathematical overs.

2. Required Run Rate (RRR)

For the chasing team, the RRR tells them how many runs they need per over to win the match.

RRR = Runs Needed to Win / Overs Remaining

Why "0.6" isn't a valid over input

In cricket, an over consists of 6 balls. The decimal notation used (e.g., 4.1, 4.2) represents balls, not fractions of 10. The count goes:

  • 4.1 (4 overs, 1 ball)
  • 4.5 (4 overs, 5 balls)
  • 5.0 (5 complete overs)

Therefore, an input of 4.6 or 4.9 is mathematically impossible in cricket notation, as the 6th ball completes the over, incrementing the integer.

Example Calculation

If India is chasing 280 runs in 50 overs and they are currently at 150 runs in 25.3 overs:

  • Runs Needed: 280 – 150 = 130 runs
  • Balls Bowled: (25 * 6) + 3 = 153 balls
  • Balls Remaining: (50 * 6) – 153 = 147 balls (24.3 overs)
  • Current Rate: 150 / (153/6) = 5.88 runs per over
  • Required Rate: 130 / (147/6) = 5.31 runs per over
function calculateRunRate() { // Clear errors var errorDisplay = document.getElementById('errorDisplay'); errorDisplay.style.display = 'none'; errorDisplay.innerText = "; // Get Inputs var runs = parseFloat(document.getElementById('runsScored').value); var oversInput = parseFloat(document.getElementById('oversBowled').value); var target = parseFloat(document.getElementById('targetScore').value); var totalOversMatch = parseFloat(document.getElementById('totalOvers').value); // Validation if (isNaN(runs) || isNaN(oversInput) || isNaN(totalOversMatch)) { errorDisplay.innerText = "Please enter valid numbers for Runs, Overs, and Total Overs."; errorDisplay.style.display = 'block'; return; } // Validate Cricket Over Logic (Decimal part cannot exceed .5) // We multiply by 10 to check the decimal integer (e.g., 4.5 -> 5) // Due to float precision, we round. var decimalPart = Math.round((oversInput % 1) * 10); if (decimalPart >= 6) { errorDisplay.innerText = "Invalid Overs format. The decimal part represents balls (1-5). Use the next whole number for 6 balls (e.g., use 5.0 instead of 4.6)."; errorDisplay.style.display = 'block'; return; } if (oversInput > totalOversMatch) { errorDisplay.innerText = "Overs bowled cannot exceed Total Overs in the match."; errorDisplay.style.display = 'block'; return; } // Logic: Convert Overs to Mathematical Overs (Base 10) // 10.3 overs = 10 * 6 + 3 = 63 balls. // 63 balls / 6 = 10.5 mathematical overs. var oversInteger = Math.floor(oversInput); var oversBalls = decimalPart; // 0 to 5 var totalBallsBowled = (oversInteger * 6) + oversBalls; if (totalBallsBowled === 0) { errorDisplay.innerText = "Overs bowled cannot be zero."; errorDisplay.style.display = 'block'; return; } var mathematicalOvers = totalBallsBowled / 6; // Calculate CRR var crr = runs / mathematicalOvers; document.getElementById('crrResult').innerText = crr.toFixed(2); // Calculate Projected Score var projected = crr * totalOversMatch; document.getElementById('projectedScore').innerText = Math.round(projected); // Calculate Chasing Stats if Target is provided var rrrBox = document.getElementById('rrrBox'); var needsBox = document.getElementById('needsBox'); var ballsBox = document.getElementById('ballsBox'); if (!isNaN(target) && target > 0) { rrrBox.style.display = 'block'; needsBox.style.display = 'block'; ballsBox.style.display = 'block'; var runsNeeded = target – runs; var totalBallsInMatch = totalOversMatch * 6; var ballsRemaining = totalBallsInMatch – totalBallsBowled; var oversRemainingMath = ballsRemaining / 6; document.getElementById('runsNeeded').innerText = runsNeeded; document.getElementById('ballsRemaining').innerText = ballsRemaining; if (ballsRemaining > 0 && runsNeeded > 0) { var rrr = runsNeeded / oversRemainingMath; document.getElementById('rrrResult').innerText = rrr.toFixed(2); } else if (runsNeeded <= 0) { document.getElementById('rrrResult').innerText = "Target Reached"; } else { document.getElementById('rrrResult').innerText = "Innings Over"; } } else { // Hide chasing specific boxes if no target rrrBox.style.display = 'none'; needsBox.style.display = 'none'; ballsBox.style.display = 'none'; } document.getElementById('resultsPanel').style.display = 'block'; }

Leave a Comment