Online Tyre Size Calculator

Online Tyre Size Calculator – Calculate Your Tyre Dimensions :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –light-gray: #e9ecef; –white: #fff; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 960px; margin: 20px auto; padding: 20px; background-color: var(–white); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } header { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(–light-gray); } header h1 { color: var(–primary-color); margin-bottom: 10px; } .calculator-section { margin-bottom: 40px; padding: 25px; background-color: var(–white); border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,0.08); } .calculator-section h2 { color: var(–primary-color); text-align: center; margin-bottom: 25px; } .loan-calc-container { display: flex; flex-direction: column; gap: 20px; } .input-group { display: flex; flex-direction: column; gap: 8px; } .input-group label { font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { padding: 10px 12px; border: 1px solid var(–border-color); border-radius: 5px; font-size: 1rem; transition: border-color 0.3s ease; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: var(–primary-color); outline: none; } .input-group small { font-size: 0.85rem; color: #6c757d; margin-top: -5px; } .error-message { color: #dc3545; font-size: 0.85rem; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; gap: 15px; margin-top: 25px; justify-content: center; } button { padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1rem; font-weight: bold; transition: background-color 0.3s ease, transform 0.2s ease; } button.primary { background-color: var(–primary-color); color: var(–white); } button.primary:hover { background-color: #003366; transform: translateY(-1px); } button.success { background-color: var(–success-color); color: var(–white); } button.success:hover { background-color: #218838; transform: translateY(-1px); } button.secondary { background-color: var(–light-gray); color: var(–text-color); border: 1px solid var(–border-color); } button.secondary:hover { background-color: #d3d9df; transform: translateY(-1px); } .results-container { margin-top: 30px; padding: 25px; background-color: var(–primary-color); color: var(–white); border-radius: 8px; text-align: center; box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); } .results-container h3 { margin-top: 0; color: var(–white); font-size: 1.4rem; } .main-result { font-size: 2.5rem; font-weight: bold; margin: 15px 0; padding: 10px; background-color: rgba(255, 255, 255, 0.15); border-radius: 5px; display: inline-block; min-width: 100px; } .intermediate-results { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 20px; } .intermediate-results div { background-color: rgba(0, 0, 0, 0.1); padding: 8px 12px; border-radius: 4px; font-size: 0.9rem; } .intermediate-results span { font-weight: bold; font-size: 1.1rem; display: block; } .formula-explanation { margin-top: 15px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 15px; } .table-section, .chart-section { margin-top: 40px; padding: 25px; background-color: var(–white); border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,0.08); } .table-section h2, .chart-section h2 { color: var(–primary-color); text-align: center; margin-bottom: 25px; } table { width: 100%; border-collapse: collapse; margin-top: 15px; } th, td { padding: 10px 12px; text-align: left; border: 1px solid var(–border-color); } th { background-color: var(–primary-color); color: var(–white); font-weight: bold; } td { background-color: var(–white); } table caption { caption-side: top; font-weight: bold; font-size: 1.1rem; color: var(–primary-color); margin-bottom: 15px; text-align: left; } canvas { max-width: 100%; height: auto; display: block; margin: 20px auto 0 auto; } .chart-legend { text-align: center; margin-top: 15px; font-size: 0.9rem; } .chart-legend span { display: inline-block; margin: 0 10px; color: var(–primary-color); } .chart-legend span::before { content: "; display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: middle; border-radius: 2px; } .legend-current::before { background-color: var(–primary-color); } .legend-original::before { background-color: var(–success-color); } .article-section { margin-top: 40px; padding: 25px; background-color: var(–white); border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,0.08); } .article-section h2, .article-section h3 { color: var(–primary-color); margin-bottom: 20px; } .article-section h3 { margin-top: 25px; } .article-section p { margin-bottom: 15px; } .article-section ul { padding-left: 25px; margin-bottom: 15px; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; } .faq-item h4 { color: var(–primary-color); margin-bottom: 5px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; } .faq-item h4::after { content: '+'; font-size: 1.2rem; color: var(–primary-color); transition: transform 0.3s ease; } .faq-item.active h4::after { transform: rotate(45deg); } .faq-item div { display: none; padding-top: 10px; border-top: 1px dashed var(–light-gray); margin-top: 5px; font-size: 0.95rem; } .related-links ul { list-style: none; padding: 0; } .related-links li { margin-bottom: 10px; } .related-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .related-links a:hover { text-decoration: underline; } .related-links span { display: block; font-size: 0.9rem; color: #6c757d; margin-top: 4px; } #copyStatus { color: var(–success-color); font-weight: bold; margin-left: 15px; display: none; } .copied { display: inline-block !important; } /* Responsive adjustments */ @media (min-width: 768px) { .container { margin: 30px auto; padding: 30px; } .button-group { justify-content: center; } } @media (max-width: 480px) { .button-group { flex-direction: column; align-items: center; } button { width: 80%; } .results-container { padding: 20px; } .main-result { font-size: 2rem; } .intermediate-results div { width: calc(50% – 10px); /* Two columns on small screens */ } }

Online Tyre Size Calculator

Instantly calculate and compare tyre sizes for your vehicle.

Tyre Size Calculator

Enter the diameter of your current or original tyre in millimeters (mm).
Enter the diameter of the new tyre you are considering in millimeters (mm).
Enter the speed rating symbol of your current tyre (e.g., H, V, W, Y).
Enter the speed rating symbol of the new tyre you are considering (e.g., H, V, W, Y).

Tyre Size Comparison Results

The difference in tyre diameter affects your vehicle's speedometer accuracy and actual performance. Larger diameters can increase ground clearance and potentially affect gearing.
Diameter Difference (mm)
Diameter % Change
Speedometer Error (%)
Speed Rating Change

Tyre Speed Ratings

Common Tyre Speed Rating Symbols
Symbol Maximum Speed (km/h) Maximum Speed (mph)
J10062
K11068
L12075
M13081
N14087
P15093
Q16099
R170106
S180112
T190118
U200124
H210130
V240149
W270168
Y300186
(Y)Over 300Over 186

Tyre Diameter Comparison

Original Tyre Diameter New Tyre Diameter

What is an Online Tyre Size Calculator?

An online tyre size calculator is a specialized tool designed to help vehicle owners, enthusiasts, and mechanics quickly determine and compare the dimensions of different tyre sizes. It helps users understand how changing their tyre size might impact their vehicle's performance, speedometer accuracy, and even its appearance. By inputting key figures of your current tyre and the desired new tyre, the calculator provides crucial data points such as the difference in diameter, percentage change, and the resulting effect on your speedometer readings. This tool is invaluable for anyone considering upgrading or replacing their tyres, ensuring they make informed decisions that align with their vehicle's specifications and their driving needs.

Who should use it: Anyone looking to change their tyre size. This includes car owners wanting to improve aesthetics or off-road capability with larger tyres, performance drivers seeking better grip with lower-profile tyres, or even those simply replacing worn-out tyres who want to understand the implications of choosing a slightly different size. It's also useful for mechanics and tyre shops to quickly provide clients with accurate information.

Common misconceptions: A frequent misconception is that any tyre size can be fitted to a vehicle without consequence. In reality, significant deviations from the original tyre size can lead to speedometer errors, inaccurate odometer readings, increased wear on drivetrain components, issues with electronic stability control systems, and even affect fuel efficiency. Another misconception is that a larger diameter tyre always means better off-road performance; while it can increase ground clearance, it also changes the vehicle's gearing and can make it harder to accelerate.

Tyre Size Calculator Formula and Mathematical Explanation

The core of the online tyre size calculator lies in a few fundamental geometric and comparative formulas. These calculations allow us to quantify the impact of switching from one tyre size to another.

Calculating Tyre Diameter and Related Metrics

Tyre size is typically expressed in a format like P215/60R16. Here's what those numbers mean:

  • P: Passenger car tyre.
  • 215: Section Width (mm) – The width of the tyre from sidewall to sidewall.
  • 60: Aspect Ratio (%) – The height of the sidewall as a percentage of the section width.
  • R: Radial construction.
  • 16: Rim Diameter (inches) – The diameter of the wheel rim the tyre fits onto.

To calculate the overall diameter of a tyre from this information, we use the following formula:

Overall Tyre Diameter = (Section Width * Aspect Ratio / 100) * 2 + (Rim Diameter * 25.4)

The '* 2' accounts for both the sidewall heights on either side of the tyre. 'Rim Diameter * 25.4' converts the rim diameter from inches to millimeters.

Comparing Tyre Sizes (The Calculator's Core Logic)

Our calculator simplifies this by directly asking for the Original Tyre Diameter and the New Tyre Diameter in millimeters. This allows for direct comparison.

1. Diameter Difference (mm):

Diameter Difference = New Tyre Diameter - Original Tyre Diameter

2. Diameter Percentage Change (%):

Percentage Change = (Diameter Difference / Original Tyre Diameter) * 100

3. Speedometer Error (%):

The speedometer is calibrated for the original tyre size. A change in diameter means the wheel travels a different distance per revolution. If the new tyre is larger, the speedometer will read lower than the actual speed. If smaller, it will read higher.

Speedometer Error = Percentage Change

(Note: This is a direct approximation. A positive percentage change means the new tyre is larger, and the speedometer will read lower than actual speed. A negative change means the new tyre is smaller, and the speedometer will read higher.)

4. Speed Rating Impact:

This is a qualitative comparison. We check if the new tyre's speed rating meets or exceeds the original. A decrease in speed rating can compromise safety at higher speeds.

Variable Explanations Table

Variables Used in Tyre Size Calculations
Variable Meaning Unit Typical Range
Original Tyre Diameter The diameter of the currently fitted or original tyre. Millimeters (mm) 300 – 1000+
New Tyre Diameter The diameter of the prospective new tyre. Millimeters (mm) 300 – 1000+
Diameter Difference The absolute difference in diameter between the new and original tyre. Millimeters (mm) -500 to +500 (approx)
Percentage Change The relative change in diameter compared to the original tyre. Percent (%) -20% to +20% (common)
Speedometer Error The approximate error introduced to the speedometer reading due to the change in tyre diameter. Percent (%) -20% to +20% (approx)
Original Speed Rating The maximum speed capability of the original tyre. Symbol (e.g., H, V) J, K, L, M, N, P, Q, R, S, T, U, H, V, W, Y, (Y)
New Speed Rating The maximum speed capability of the new tyre. Symbol (e.g., H, V) J, K, L, M, N, P, Q, R, S, T, U, H, V, W, Y, (Y)

Practical Examples (Real-World Use Cases)

Example 1: Upgrading to Larger Off-Road Tyres

Scenario: A 4×4 owner wants to fit larger tyres for better off-road performance. Their current tyres have a diameter of 700mm, and they are considering new tyres with a diameter of 760mm. Both tyres have an 'H' speed rating.

Inputs:

  • Original Tyre Diameter: 700 mm
  • New Tyre Diameter: 760 mm
  • Original Speed Rating: H
  • New Speed Rating: H

Calculated Results:

  • Main Result: +60 mm (Increase in Diameter)
  • Diameter Difference: 60 mm
  • Diameter % Change: 8.57%
  • Speedometer Error: 8.57% (Speedometer will read approx. 8.57% lower than actual speed)
  • Speed Rating Impact: No Change (Remains H)

Interpretation: The new tyres increase the vehicle's ground clearance by approximately 30mm (half the diameter difference). However, the speedometer will now read lower. At 100 km/h indicated on the dashboard, the vehicle is actually travelling around 108.57 km/h. This necessitates caution and potentially recalibration of the speedometer for accurate legal driving. The speed rating remains adequate for the vehicle.

Example 2: Switching to Lower Profile Tyres for Performance

Scenario: A sports car owner wants to switch from standard tyres (diameter 640mm, speed rating V) to lower profile tyres for better handling (diameter 630mm, speed rating W).

Inputs:

  • Original Tyre Diameter: 640 mm
  • New Tyre Diameter: 630 mm
  • Original Speed Rating: V
  • New Speed Rating: W

Calculated Results:

  • Main Result: -10 mm (Decrease in Diameter)
  • Diameter Difference: -10 mm
  • Diameter % Change: -1.56%
  • Speedometer Error: -1.56% (Speedometer will read approx. 1.56% higher than actual speed)
  • Speed Rating Impact: Increased (From V to W)

Interpretation: The new, lower profile tyres slightly reduce the vehicle's overall diameter. This means the speedometer will read slightly faster than the actual speed. At 100 km/h indicated, the actual speed is closer to 98.44 km/h. The upgrade to a 'W' speed rating is positive, offering a higher safety margin at high speeds, which aligns with the car's performance intentions.

How to Use This Online Tyre Size Calculator

Using our online tyre size calculator is straightforward. Follow these steps to get accurate comparisons:

  1. Locate Current Tyre Information: Check the sidewall of your current tyres or your vehicle's owner's manual. You need the overall diameter in millimeters (mm). If you only have the size code (e.g., 205/55R16), use a tyre size calculator that converts codes to diameter first, or input the calculated diameter here.
  2. Find New Tyre Information: Determine the overall diameter (in mm) of the new tyre size you are considering. Also, note its speed rating symbol (e.g., H, V, W).
  3. Input Data: Enter the 'Original Tyre Diameter' and 'New Tyre Diameter' into the respective fields in millimeters. Input the 'Original Speed Rating' and 'New Speed Rating' symbols.
  4. Calculate: Click the 'Calculate' button.
  5. Review Results: The calculator will display the primary result (diameter difference), along with key intermediate values like percentage change, speedometer error, and speed rating comparison.
  6. Interpret Findings: Understand how the changes affect your vehicle. Pay close attention to the speedometer error and ensure the new speed rating is appropriate.
  7. Reset or Copy: Use the 'Reset' button to clear fields and start over. Use 'Copy Results' to save the comparison data.

How to read results: The main result shows the direct change in millimeters. A positive number means the new tyre is larger; a negative number means it's smaller. The percentage change and speedometer error indicate the relative impact. A positive speedometer error percentage means your speedometer will read higher than your actual speed (you're going faster than indicated). A negative percentage means your speedometer will read lower than your actual speed (you're going slower than indicated).

Decision-making guidance: Aim for minimal changes in tyre diameter (ideally less than 3% difference) to keep speedometer and odometer readings accurate and avoid unnecessary strain on drivetrain components. Always ensure the new tyre's speed rating is equal to or higher than the original rating for safety. If significantly increasing tyre size, consider potential impacts on fuel economy, braking distance, and handling.

Key Factors That Affect Tyre Size Calculator Results

While the online tyre size calculator provides fundamental data, several real-world factors influence the practical implications of tyre size changes:

  1. Vehicle's Original Tyre Specifications: The starting point is crucial. The calculator's accuracy relies on correct input of the original tyre diameter. Deviations from factory-recommended sizes can already introduce inaccuracies.
  2. Rim Diameter: While our calculator uses overall diameter, the rim diameter dictates the available tyre profile options. A larger rim generally requires a lower aspect ratio tyre to maintain a similar overall diameter.
  3. Aspect Ratio (Sidewall Profile): This percentage directly impacts the tyre's sidewall height. Lowering the aspect ratio (e.g., from 60 to 50) reduces the sidewall height, affecting ride comfort and the overall diameter.
  4. Load Index: Similar to speed rating, the load index indicates the maximum weight a tyre can carry. Ensure the new tyre's load index is sufficient for your vehicle's weight. Exceeding this limit is dangerous.
  5. Tyre Construction and Tread Pattern: Different tread patterns and internal constructions (e.g., all-terrain vs. highway tyres) can have slightly different actual measurements compared to their stated sizes, leading to minor variations.
  6. Tyre Pressure: Incorrect tyre pressure affects the tyre's actual diameter and contact patch. Maintaining recommended pressures is vital for accurate performance and safety, and influences how a tyre behaves regardless of size.
  7. Suspension and Ride Height: Significantly larger tyres may rub against the wheel arches or suspension components, especially during turns or when the suspension is compressed. This physical limitation must be considered beyond mere diameter calculations.
  8. Gearing and Drivetrain: Changes in tyre diameter alter the effective gear ratio. Larger tyres make the vehicle accelerate slower but can improve fuel efficiency at highway speeds (if not offset by increased weight/rolling resistance). Smaller tyres do the opposite. This impacts the transmission and differential.

Frequently Asked Questions (FAQ)

What is the ideal tyre diameter percentage change?

The general recommendation is to keep the change in tyre diameter within +/- 3% of the original size. Exceeding this can lead to significant speedometer errors, potential drivetrain stress, and may even be illegal in some regions.

Can I fit larger tyres than recommended?

Yes, but with caveats. Larger tyres increase ground clearance and can fill wheel wells for a more aggressive look. However, they can cause speedometer inaccuracies, impact acceleration, potentially affect fuel economy, and may rub against fenders or suspension components, requiring modifications.

What happens if my speedometer is inaccurate?

An inaccurate speedometer leads to incorrect speed readings, affecting your compliance with speed limits. It also means your odometer reading will be inaccurate, impacting mileage tracking for maintenance, resale value, and lease agreements.

Do different speed rating symbols mean different tyre performance?

Yes, speed rating symbols indicate the maximum speed capability of a tyre under optimal conditions. Higher speed ratings (like W or Y) are typically associated with tyres offering better handling, grip, and stability at high speeds, often at the expense of ride comfort or tread life.

How does tyre width affect diameter?

Tyre width (section width) is one component used to calculate the overall diameter. A wider tyre, with the same aspect ratio and rim diameter, will have a larger overall diameter. Our calculator simplifies by using the direct overall diameter input.

What is the difference between radial and bias-ply tyres?

Radial tyres (marked with 'R') have internal layers running perpendicular to the direction of travel, offering better flexibility, heat dissipation, and fuel efficiency. Bias-ply tyres have layers running diagonally. Radial is standard for most modern passenger vehicles.

Does changing tyre size affect my car's warranty?

Using tyre sizes significantly outside the manufacturer's specifications can potentially void the warranty on related components, such as the transmission, suspension, or even ABS/traction control systems, if a failure can be directly attributed to the non-standard tyre size. Always consult your vehicle's warranty documentation.

Can I mix tyre sizes on my vehicle?

It is strongly advised NOT to mix tyre sizes (width, aspect ratio, diameter) between the front and rear axles, or even side-to-side, unless specifically recommended by the vehicle manufacturer (e.g., some performance cars). Mixing sizes can severely impact handling, stability, braking, and the function of all-wheel-drive or traction control systems.

How do I calculate my tyre's diameter if I only have the size code (e.g., 205/55R16)?

To calculate the diameter:
1. Section Width = 205 mm
2. Aspect Ratio = 55%
3. Rim Diameter = 16 inches
Sidewall Height = Section Width * (Aspect Ratio / 100) = 205 * (55 / 100) = 112.75 mm
Tyre Diameter = (Sidewall Height * 2) + (Rim Diameter * 25.4) = (112.75 * 2) + (16 * 25.4) = 225.5 + 406.4 = 631.9 mm. Our calculator uses this final diameter value.

Related Tools and Internal Resources

© 2023 Your Website Name. All rights reserved. This calculator and content are for informational purposes only.
var originalDiameterInput = document.getElementById("originalDiameter"); var newDiameterInput = document.getElementById("newDiameter"); var originalSpeedRatingInput = document.getElementById("originalSpeedRating"); var newSpeedRatingInput = document.getElementById("newSpeedRating"); var originalDiameterError = document.getElementById("originalDiameterError"); var newDiameterError = document.getElementById("newDiameterError"); var originalSpeedRatingError = document.getElementById("originalSpeedRatingError"); var newSpeedRatingError = document.getElementById("newSpeedRatingError"); var resultsContainer = document.getElementById("resultsContainer"); var mainResultDisplay = document.getElementById("mainResult"); var diameterDifferenceDisplay = document.getElementById("diameterDifference").querySelector('span'); var percentageChangeDisplay = document.getElementById("percentageChange").querySelector('span'); var speedometerErrorDisplay = document.getElementById("speedometerError").querySelector('span'); var speedRatingImpactDisplay = document.getElementById("speedRatingImpact").querySelector('span'); var chart = null; var chartContext = null; var speedRatingMap = { 'J': 100, 'K': 110, 'L': 120, 'M': 130, 'N': 140, 'P': 150, 'Q': 160, 'R': 170, 'S': 180, 'T': 190, 'U': 200, 'H': 210, 'V': 240, 'W': 270, 'Y': 300, '(Y)': 300 }; function initializeChart() { chartContext = document.getElementById('diameterChart').getContext('2d'); chart = new Chart(chartContext, { type: 'bar', data: { labels: ['Tyre Diameter'], datasets: [{ label: 'Original Tyre Diameter', data: [], backgroundColor: 'var(–primary-color)', borderColor: 'var(–primary-color)', borderWidth: 1 }, { label: 'New Tyre Diameter', data: [], backgroundColor: 'var(–success-color)', borderColor: 'var(–success-color)', borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Diameter (mm)' } } }, plugins: { legend: { display: false // Legend is handled by the custom div }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.y !== null) { label += context.parsed.y + ' mm'; } return label; } } } } } }); } function updateChart(originalDiameter, newDiameter) { if (!chart) { initializeChart(); } chart.data.datasets[0].data = [originalDiameter]; chart.data.datasets[1].data = [newDiameter]; chart.update(); } function validateInput(inputElement, errorElement, min, max, fieldName) { var value = parseFloat(inputElement.value); var errorMsg = ""; if (isNaN(value)) { errorMsg = fieldName + " must be a valid number."; inputElement.style.borderColor = "#dc3545″; } else if (value <= 0) { errorMsg = fieldName + " cannot be zero or negative."; inputElement.style.borderColor = "#dc3545"; } else if (min !== null && value max) { errorMsg = fieldName + " cannot exceed " + max + "."; inputElement.style.borderColor = "#dc3545"; } else { inputElement.style.borderColor = "#ced4da"; // Default border color } errorElement.textContent = errorMsg; errorElement.style.display = errorMsg ? "block" : "none"; return !errorMsg; } function validateSpeedRating(inputElement, errorElement, fieldName) { var value = inputElement.value.trim().toUpperCase(); var errorMsg = ""; if (!value) { errorMsg = fieldName + " is required."; inputElement.style.borderColor = "#dc3545"; } else if (!speedRatingMap.hasOwnProperty(value)) { errorMsg = "Invalid speed rating symbol. Use H, V, W, Y, etc."; inputElement.style.borderColor = "#dc3545"; } else { inputElement.style.borderColor = "#ced4da"; } errorElement.textContent = errorMsg; errorElement.style.display = errorMsg ? "block" : "none"; return !errorMsg; } function calculateTyreSize() { var isValid = true; // Validate Diameter Inputs isValid &= validateInput(originalDiameterInput, originalDiameterError, 100, 1500, "Original Tyre Diameter"); isValid &= validateInput(newDiameterInput, newDiameterError, 100, 1500, "New Tyre Diameter"); // Validate Speed Rating Inputs isValid &= validateSpeedRating(originalSpeedRatingInput, originalSpeedRatingError, "Original Speed Rating"); isValid &= validateSpeedRating(newSpeedRatingInput, newSpeedRatingError, "New Speed Rating"); if (!isValid) { resultsContainer.style.display = "none"; return; } var originalDiameter = parseFloat(originalDiameterInput.value); var newDiameter = parseFloat(newDiameterInput.value); var originalSpeedRating = originalSpeedRatingInput.value.trim().toUpperCase(); var newSpeedRating = newSpeedRatingInput.value.trim().toUpperCase(); var diameterDifference = newDiameter – originalDiameter; var percentageChange = (diameterDifference / originalDiameter) * 100; var speedometerError = percentageChange; // Speedometer error is directly the percentage change var originalSpeedValue = speedRatingMap[originalSpeedRating]; var newSpeedValue = speedRatingMap[newSpeedRating]; var speedRatingImpact = ""; if (newSpeedValue originalSpeedValue) { speedRatingImpact = "Increased (Improved)"; } else { speedRatingImpact = "No Change"; } // Format results var formattedDiameterDifference = diameterDifference.toFixed(2); var formattedPercentageChange = percentageChange.toFixed(2); var formattedSpeedometerError = speedometerError.toFixed(2); // Determine main result display var mainResultText = formattedDiameterDifference + " mm"; if (diameterDifference > 0) { mainResultText += " (Larger)"; } else if (diameterDifference < 0) { mainResultText += " (Smaller)"; } else { mainResultText = "No Change"; } mainResultDisplay.textContent = mainResultText; diameterDifferenceDisplay.textContent = formattedDiameterDifference; percentageChangeDisplay.textContent = formattedPercentageChange + "%"; speedometerErrorDisplay.textContent = formattedSpeedometerError + "%"; speedRatingImpactDisplay.textContent = speedRatingImpact; resultsContainer.style.display = "block"; // Update Chart updateChart(originalDiameter, newDiameter); } function resetCalculator() { originalDiameterInput.value = "650"; newDiameterInput.value = "680"; originalSpeedRatingInput.value = "H"; newSpeedRatingInput.value = "V"; // Clear errors originalDiameterError.textContent = ""; originalDiameterError.style.display = "none"; newDiameterError.textContent = ""; newDiameterError.style.display = "none"; originalSpeedRatingError.textContent = ""; originalSpeedRatingError.style.display = "none"; newSpeedRatingError.textContent = ""; newSpeedRatingError.style.display = "none"; originalDiameterInput.style.borderColor = "#ced4da"; newDiameterInput.style.borderColor = "#ced4da"; originalSpeedRatingInput.style.borderColor = "#ced4da"; newSpeedRatingInput.style.borderColor = "#ced4da"; resultsContainer.style.display = "none"; if(chart) { chart.data.datasets[0].data = []; chart.data.datasets[1].data = []; chart.update(); } } function copyResults() { var originalDiameter = originalDiameterInput.value; var newDiameter = newDiameterInput.value; var originalSpeedRating = originalSpeedRatingInput.value; var newSpeedRating = newSpeedRatingInput.value; var diameterDifference = diameterDifferenceDisplay.textContent; var percentageChange = percentageChangeDisplay.textContent; var speedometerError = speedometerErrorDisplay.textContent; var speedRatingImpact = speedRatingImpactDisplay.textContent; var mainResult = mainResultDisplay.textContent; var copyText = "— Tyre Size Comparison —\n\n"; copyText += "Original Tyre Diameter: " + originalDiameter + " mm\n"; copyText += "New Tyre Diameter: " + newDiameter + " mm\n"; copyText += "Original Speed Rating: " + originalSpeedRating + "\n"; copyText += "New Speed Rating: " + newSpeedRating + "\n\n"; copyText += "— Results —\n"; copyText += "Diameter Difference: " + diameterDifference + "\n"; copyText += "Diameter % Change: " + percentageChange + "\n"; copyText += "Speedometer Error: " + speedometerError + "\n"; copyText += "Speed Rating Impact: " + speedRatingImpact + "\n"; copyText += "Summary: " + mainResult + "\n\n"; copyText += "Key Assumptions: Speedometer error is an approximation. Ensure speed rating meets or exceeds original for safety."; navigator.clipboard.writeText(copyText).then(function() { var copyStatus = document.getElementById("copyStatus"); copyStatus.textContent = "Copied!"; copyStatus.classList.add("copied"); setTimeout(function() { copyStatus.classList.remove("copied"); }, 2000); }, function(err) { console.error("Failed to copy text: ", err); var copyStatus = document.getElementById("copyStatus"); copyStatus.textContent = "Failed!"; copyStatus.classList.add("copied"); setTimeout(function() { copyStatus.classList.remove("copied"); }, 2000); }); } function toggleFaq(element) { var parent = element.parentElement; parent.classList.toggle('active'); } // Initial calculation on page load document.addEventListener("DOMContentLoaded", function() { calculateTyreSize(); // Add event listeners for real-time updates originalDiameterInput.addEventListener('input', calculateTyreSize); newDiameterInput.addEventListener('input', calculateTyreSize); originalSpeedRatingInput.addEventListener('input', calculateTyreSize); newSpeedRatingInput.addEventListener('input', calculateTyreSize); }); // Basic Chart.js include (for demonstration – in production, you'd link this externally) // For a single HTML file, you could inline it or expect it to be available globally // Here, we assume Chart.js is loaded via an external CDN or inline script before this script runs. // Example CDN:

Leave a Comment