Tire and Wheel Offset Calculator

Tire and Wheel Offset Calculator: Optimize Your Vehicle's Stance :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –shadow-color: rgba(0, 0, 0, 0.1); } 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: 1000px; margin: 20px auto; padding: 20px; background-color: #fff; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); } h1, h2, h3 { color: var(–primary-color); } h1 { text-align: center; margin-bottom: 15px; } h2 { border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; margin-top: 30px; } .calculator-section { background-color: #eef2f6; padding: 25px; border-radius: 8px; margin-bottom: 30px; } .loan-calc-container { display: flex; flex-wrap: wrap; gap: 15px; } .input-group { flex: 1 1 100%; margin-bottom: 15px; background-color: #fff; padding: 15px; border-radius: 5px; box-shadow: inset 0 1px 3px var(–shadow-color); } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 20px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1rem; } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .input-group .error-message { color: #dc3545; font-size: 0.9em; margin-top: 5px; display: block; height: 1.2em; /* Reserve space */ } .button-group { display: flex; gap: 10px; margin-top: 20px; justify-content: center; flex-wrap: wrap; } 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; } #calculateBtn { background-color: var(–primary-color); color: white; } #calculateBtn:hover { background-color: #003366; transform: translateY(-2px); } #resetBtn { background-color: #6c757d; color: white; } #resetBtn:hover { background-color: #5a6268; transform: translateY(-2px); } #copyBtn { background-color: #ffc107; color: #212529; } #copyBtn:hover { background-color: #e0a800; transform: translateY(-2px); } .results-container { margin-top: 25px; padding: 20px; background-color: var(–primary-color); color: white; border-radius: 8px; text-align: center; box-shadow: 0 2px 10px var(–shadow-color); } .results-container h3 { color: white; margin-bottom: 15px; } #mainResult { font-size: 2.5em; font-weight: bold; margin-bottom: 10px; word-wrap: break-word; } .intermediate-results div, .assumption-details div { margin-bottom: 8px; font-size: 1.1em; } .intermediate-results span, .assumption-details span { font-weight: bold; } .formula-explanation { font-size: 0.9em; color: #eee; margin-top: 15px; padding-top: 10px; border-top: 1px solid #555; } table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 30px; box-shadow: 0 2px 5px var(–shadow-color); } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } thead th { background-color: var(–primary-color); color: white; font-weight: bold; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; margin-bottom: 10px; color: var(–text-color); text-align: left; } #myChart { display: block; margin: 20px auto; border: 1px solid var(–border-color); border-radius: 5px; background-color: #fff; } .chart-container { text-align: center; margin-bottom: 30px; } .chart-legend { display: flex; justify-content: center; gap: 20px; margin-top: 10px; font-size: 0.9em; } .chart-legend span { display: inline-block; width: 15px; height: 15px; margin-right: 5px; vertical-align: middle; border: 1px solid var(–border-color); } .article-content { margin-top: 40px; background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); } .article-content h2 { margin-top: 30px; border-bottom: 1px solid var(–primary-color); } .article-content h3 { margin-top: 20px; color: #0056b3; } .article-content p { margin-bottom: 15px; } .article-content ul, .article-content ol { margin-left: 20px; margin-bottom: 15px; } .article-content li { margin-bottom: 8px; } .article-content strong { color: var(–primary-color); } .faq-item { margin-bottom: 15px; padding: 10px; border: 1px solid #eee; border-radius: 4px; background-color: #fdfdfd; } .faq-item h3 { margin-bottom: 5px; font-size: 1.1em; cursor: pointer; color: var(–primary-color); } .faq-item p { display: none; /* Initially hidden */ margin-top: 10px; font-size: 0.95em; color: #555; } .faq-item.open p { display: block; } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 10px; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links p { font-size: 0.9em; color: #666; margin-top: 5px; }

Tire and Wheel Offset Calculator: Optimize Your Vehicle's Stance

Wheel Offset Calculator

The diameter of the wheel rim.
The width of the wheel rim.
The width of the tire from sidewall to sidewall.
The ratio of sidewall height to tire width (e.g., 40 for 40%).
The offset of your current wheel setup.
The desired offset for your new wheels.

Fitment Difference

0 mm
Inner Clearance Change: 0 mm
Outer Clearance Change: 0 mm
Track Width Change: 0 mm
Calculates the difference in wheel positioning, affecting inner and outer clearance, and track width.

Fitment Comparison Table

Current vs. New Wheel & Tire Dimensions
Measurement Current Setup New Setup
Wheel Width (in) N/A N/A
Wheel Offset (mm) N/A N/A
Tire Width (mm) N/A N/A
Tire Diameter (in) N/A N/A
Wheel + Tire Overall Width (in) N/A N/A
Inner Clearance (mm) N/A N/A
Outer Clearance (mm) N/A N/A
Track Width Change (mm) N/A N/A

Clearance Visualization

Current Inner Clearance New Inner Clearance Current Outer Clearance New Outer Clearance

What is Wheel Offset?

Wheel offset is a critical measurement that defines the position of the wheel hub mounting surface relative to the centerline of the wheel. It's expressed in millimeters (mm) and plays a pivotal role in how your wheels and tires fit within your vehicle's fender wells. Understanding and correctly calculating wheel offset is essential for preventing tire rub, ensuring proper suspension geometry, and achieving your desired vehicle stance. Whether you're upgrading wheels, installing new tires, or modifying your suspension, a precise tire and wheel offset calculator is your indispensable tool.

This calculator is for vehicle owners, automotive enthusiasts, mechanics, and custom wheel shops who need to determine the compatibility and impact of changing wheel and tire sizes on a vehicle. It helps visualize the clearance changes and potential fitment issues before purchasing new parts.

Common misconceptions include thinking that a larger wheel diameter automatically means more clearance, or that any wheel with the same bolt pattern will fit. In reality, offset, backspacing, and the overall tire dimensions are far more critical factors for proper fitment and avoiding costly damage. The tire and wheel offset calculator helps clarify these complex relationships.

Tire and Wheel Offset Calculation and Mathematical Explanation

The core of this calculator involves converting tire dimensions into physical measurements and then calculating how changes in wheel offset affect the position of the wheel and tire assembly relative to the vehicle's suspension components and the fender.

Key Calculations:

  1. Tire Section Height: This is the height of the tire's sidewall. It's calculated from the tire's width and aspect ratio.
    Tire Section Height (mm) = Tire Width (mm) * (Tire Aspect Ratio / 100)
  2. Tire Diameter: This is the overall diameter of the inflated tire.
    Tire Diameter (in) = Wheel Diameter (in) + 2 * Tire Section Height (mm) / 25.4 (Divide by 25.4 to convert mm to inches)
  3. Wheel Width (in Inches): Convert wheel width from inches to mm for easier comparison with offset.
    Wheel Width (mm) = Wheel Width (in) * 25.4
  4. Wheel Centerline: This is the reference point for offset.
  5. Offset Calculation: Offset is the distance from the wheel's centerline to the hub mounting surface.
    • Positive Offset (+mm): Hub surface is mounted outwards from the centerline.
    • Negative Offset (-mm): Hub surface is mounted inwards from the centerline.
    • Zero Offset (0mm): Hub surface is exactly on the centerline.
  6. Backspacing: The distance from the wheel's mounting surface to the inside edge of the wheel.
    Backspacing (in) = Wheel Width (in) / 2 + Offset (mm) / 25.4 (Adjust sign of offset based on its definition relative to centerline)
  7. Clearance Changes: The primary output of our calculator. It's the difference in the position of the wheel's inner and outer edges relative to the vehicle's mounting surface when changing offsets.
    Clearance Change (mm) = New Offset (mm) - Current Offset (mm)
    • A positive clearance change means the wheel moves outward (towards the fender).
    • A negative clearance change means the wheel moves inward (towards the suspension).
  8. Track Width Change: The total change in the distance between the centers of the wheels on the same axle.
    Track Width Change (mm) = (New Offset (mm) - Current Offset (mm)) * 2 (Because each wheel's change affects track width twice)

Variables Table:

Key Variables in Tire and Wheel Offset Calculations
Variable Meaning Unit Typical Range
Wheel Diameter Overall size of the wheel rim. inches 14 – 30+
Wheel Width Width of the wheel rim. inches 4 – 15+
Tire Width Sidewall to sidewall width of the tire. mm 145 – 335+
Tire Aspect Ratio Sidewall height as a percentage of tire width. % 25 – 85
Wheel Offset Distance from wheel centerline to hub mounting surface. mm -50 to +70 (Varies widely by vehicle)
Inner Clearance Space between the inside of the wheel/tire and suspension components. mm Critical minimums apply
Outer Clearance Space between the outside of the tire and the fender. mm Critical minimums apply
Track Width Distance between the centerlines of the wheels on the same axle. mm Vehicle specific

Practical Examples (Real-World Use Cases)

Example 1: Upgrading to Wider Wheels with Lower Offset

Scenario: A driver has a sedan with stock wheels (17×7 inches, +45mm offset) and tires (225/50R17). They want to install new wheels that are wider (18×8.5 inches) with a lower offset (+35mm) and slightly wider tires (245/40R18) for a more aggressive stance and improved handling.

Inputs:

  • Current Wheel: 17 x 7.0 inches, +45 mm offset
  • Current Tire: 225/50R17
  • New Wheel: 18 x 8.5 inches, +35 mm offset
  • New Tire: 245/40R18

Calculator Results:

  • Fitment Difference: -10 mm (The new wheel setup will sit 10mm further OUTWARD compared to the current setup.)
  • Inner Clearance Change: -10 mm (The inside of the new wheel/tire will be 10mm closer to the suspension.)
  • Outer Clearance Change: -10 mm (The outside of the new tire will be 10mm closer to the fender.)
  • Track Width Change: -20 mm (The total track width will decrease by 20mm.)

Interpretation: The new wheel setup moves outward by 10mm. This is a relatively mild change. The user must ensure that the new tire (245mm width) still has at least 10mm of clearance from the fender lip at full suspension compression and steering lock. They also need to verify that the inner clearance change of -10mm does not cause the new tire to rub against suspension components like the strut or control arm. The reduced track width might slightly affect cornering stability.

Example 2: Increasing Wheel Diameter with Higher Offset

Scenario: A truck owner has 20×9 inch wheels with +20mm offset and 275/55R20 tires. They are considering 22×10 inch wheels with a higher offset (+30mm) and similar overall tire diameter (285/45R22).

Inputs:

  • Current Wheel: 20 x 9.0 inches, +20 mm offset
  • Current Tire: 275/55R20
  • New Wheel: 22 x 10.0 inches, +30 mm offset
  • New Tire: 285/45R22

Calculator Results:

  • Fitment Difference: +10 mm (The new wheel setup will sit 10mm further INWARD compared to the current setup.)
  • Inner Clearance Change: +10 mm (The inside of the new wheel/tire will be 10mm further away from the suspension.)
  • Outer Clearance Change: +10 mm (The outside of the new tire will be 10mm further away from the fender.)
  • Track Width Change: +20 mm (The total track width will increase by 20mm.)

Interpretation: Despite the wider new wheels (10 inches vs 9 inches), the higher offset (+30mm vs +20mm) results in the assembly moving inward by 10mm relative to the hub mounting surface. This increases both inner and outer clearance by 10mm. The wider tire (285mm vs 275mm) will contribute to the overall width, but the offset change is the dominant factor in its position relative to the vehicle body. The increased track width can enhance stability. The user should still check for clearance, especially on the inner side, as the larger wheel diameter might introduce new limitations.

How to Use This Tire and Wheel Offset Calculator

Using the tire and wheel offset calculator is straightforward. Follow these steps to get accurate fitment information:

  1. Input Current Wheel & Tire Specs: Enter the diameter and width of your current wheels, the current offset (usually found on the wheel or in your vehicle manual), and the width and aspect ratio of your current tires.
  2. Input New Wheel & Tire Specs: Enter the desired diameter and width of your new wheels, your desired new offset, and the width and aspect ratio of the new tires you plan to use.
  3. Click 'Calculate Fitment': The calculator will instantly process your inputs.
  4. Review Results:
    • Fitment Difference: This is the primary result, showing how much the new setup will move inward or outward relative to your current setup. A positive value means inward, negative means outward.
    • Inner/Outer Clearance Change: These indicate how much closer or farther away the inside and outside edges of the wheel/tire assembly will be from their current positions.
    • Track Width Change: Shows the impact on the overall width of the vehicle's stance.
  5. Analyze the Table and Chart: The table provides a detailed breakdown of all dimensions, while the chart visually represents the changes in inner and outer clearances.
  6. Make Informed Decisions: Use this data to confirm if your desired wheels and tires will fit without rubbing, if you need fender modifications (rolling/trimming), or if you need wheel spacers/adapters. Always double-check measurements against your specific vehicle's clearance limitations.
  7. Reset Defaults: If you want to start over or clear current inputs, click the 'Reset Defaults' button.
  8. Copy Results: Use the 'Copy Results' button to easily share the calculated data or save it for your records.

Remember, clearances can vary significantly based on suspension travel, steering angle, and specific vehicle body lines. This calculator provides a strong estimate, but physical checks are always recommended. A good rule of thumb is to maintain at least 10-15mm of clearance on both the inner and outer sides to account for suspension movement and slight variations.

Key Factors That Affect Tire and Wheel Offset Results

Several factors influence how wheel and tire combinations fit your vehicle, and understanding these is crucial for making the right choices. The tire and wheel offset calculator helps quantify some of these, but broader context is important:

  • Wheel Offset (The Most Direct Factor): As discussed, this dictates the wheel's position relative to the hub. Higher positive offsets move the wheel inward; lower positive or negative offsets move it outward. This directly impacts both inner fender and suspension component clearances.
  • Wheel Width: A wider wheel, even with the same offset, will position its inner and outer edges differently. The *overall width* of the wheel and tire assembly is what truly matters for clearance. A wider wheel with a high offset can easily rub the suspension.
  • Tire Width and Sidewall Height: The total diameter and width of the tire significantly affect clearance. A taller or wider tire increases the chance of rubbing against fenders, suspension components, or even other body parts, especially during turns or when the suspension is compressed.
  • Suspension Geometry and Condition: Vehicle suspension systems aren't static. Bushings can wear, leading to "slop," and the way suspension components articulate during movement can affect available space. Aftermarket suspension modifications (lowering springs, coilovers) also alter ride height and alignment, directly impacting clearance.
  • Fender Lips and Body Lines: The shape and design of your vehicle's fenders and wheel wells are critical. Some cars have rolled fender lips from the factory, while others have aggressive contours. Modifications like fender flares or "pulling" fenders will create more room.
  • Brake System Clearance: Larger brake calipers and rotors, especially common in performance vehicles or after aftermarket upgrades, can intrude into the space required by the wheel. Some wheel designs (e.g., "high-offset" or "concave" faces) are necessary to clear larger brakes, regardless of the offset number.
  • Load Rating and Tire Pressure: While not directly affecting static fitment, the load rating and recommended tire pressure can influence how much a tire deforms under load. An underinflated or heavily loaded tire can bulge outwards, potentially reducing outer clearance.
  • Alignment Settings: Camber, caster, and toe settings affect the tire's angle relative to the fender. Aggressive camber, for instance, can tuck the top of the tire inward, potentially increasing clearance, but might cause rubbing on the inner edge.

Frequently Asked Questions (FAQ)

What is the difference between offset and backspacing?

Offset measures the wheel's position relative to its centerline. Backspacing measures the distance from the wheel's mounting surface to the inner lip of the wheel rim. While related (both are affected by wheel width and offset), they describe different aspects of wheel fitment. Offset is more directly used when comparing how wheels sit relative to the vehicle body and suspension.

Can I use a wheel spacer with my current offset?

Yes, a wheel spacer effectively changes the offset. A 5mm spacer on a +35mm offset wheel would give you an equivalent offset of +30mm (moving the wheel outward). Spacers can help clear suspension components or push a wheel out for aesthetic reasons, but excessive use can strain wheel bearings and potentially cause vibration issues. Always ensure spacers are hub-centric and securely mounted.

What is considered a "safe" amount of clearance?

Generally, maintaining at least 10-15mm of clearance between the tire and the closest suspension component (inner) and fender (outer) is recommended. This accounts for tire flex, suspension travel, and manufacturing tolerances. However, "safe" can vary greatly depending on the vehicle, intended use (daily driving vs. track), and specific components.

Will changing my offset affect my car's handling?

Yes, changing wheel offset alters the scrub radius and track width, both of which influence steering feel, stability, and tire wear. A wider track width (achieved with lower offsets or spacers) can improve cornering grip but may also make the steering heavier. Significant changes can sometimes lead to increased torque steer or tramlining.

My new tires rub when turning. What should I do?

This usually means the outer edge of the tire is contacting the fender liner or fender lip. Possible solutions include:

  • Installing slightly narrower tires.
  • Using wheels with a higher offset (moving the wheel inward).
  • Using smaller diameter wheels.
  • Having the fender lips professionally rolled or trimmed.
  • Adjusting the steering stops (less common for street cars).

What does "ET" mean on a wheel marking?

"ET" is the German abbreviation for "Einpresstiefe," which translates to "press depth" – essentially, wheel offset. So, ET35 means an offset of +35mm.

Can I mix and match wheel offsets on the same axle?

It is strongly advised against mixing offsets on the same axle. Doing so creates an uneven stance, can negatively affect handling and steering dynamics (potentially causing the car to pull to one side), and can lead to uneven tire wear. Always use the same offset for both wheels on a given axle.

How does tire pressure affect fitment?

While tire pressure doesn't change the physical dimensions of the wheel or tire itself, it affects the tire's profile under load. Significantly underinflated tires can bulge more at the sidewall, potentially reducing outer clearance. Overinflated tires might offer slightly more clearance but can lead to a harsher ride and uneven wear. Always use the manufacturer's recommended tire pressure.

© 2023 Your Website Name. All rights reserved.

var wheelDiameterInput = document.getElementById('wheelDiameter'); var wheelWidthInput = document.getElementById('wheelWidth'); var tireWidthInput = document.getElementById('tireWidth'); var tireAspectRatioInput = document.getElementById('tireAspectRatio'); var currentOffsetInput = document.getElementById('currentOffset'); var newOffsetInput = document.getElementById('newOffset'); var mainResultDiv = document.getElementById('mainResult'); var innerClearanceDiv = document.getElementById('innerClearance'); var outerClearanceDiv = document.getElementById('outerClearance'); var trackWidthChangeDiv = document.getElementById('trackWidthChange'); var currentWheelWidthTable = document.getElementById('currentWheelWidthTable'); var newWheelWidthTable = document.getElementById('newWheelWidthTable'); var currentOffsetTable = document.getElementById('currentOffsetTable'); var newOffsetTable = document.getElementById('newOffsetTable'); var currentTireWidthTable = document.getElementById('currentTireWidthTable'); var newTireWidthTable = document.getElementById('newTireWidthTable'); var currentTireDiameterTable = document.getElementById('currentTireDiameterTable'); var newTireDiameterTable = document.getElementById('newTireDiameterTable'); var currentOverallWidthTable = document.getElementById('currentOverallWidthTable'); var newOverallWidthTable = document.getElementById('newOverallWidthTable'); var currentInnerClearanceTable = document.getElementById('currentInnerClearanceTable'); var newInnerClearanceTable = document.getElementById('newInnerClearanceTable'); var currentOuterClearanceTable = document.getElementById('currentOuterClearanceTable'); var newOuterClearanceTable = document.getElementById('newOuterClearanceTable'); var trackWidthChangeTable = document.getElementById('trackWidthChangeTable'); var chart; var chartCtx; function formatNumber(num, decimals = 0) { return num.toFixed(decimals).replace(/\B(?=(\d{3})+(?!\d))/g, ","); } function isValidNumber(value) { return !isNaN(parseFloat(value)) && isFinite(value); } function updateChart(currentInner, newInner, currentOuter, newOuter) { if (chart) { chart.data.datasets[0].data = [currentInner, newInner]; chart.data.datasets[1].data = [currentOuter, newOuter]; chart.update(); } } function calculateFitment() { var errors = false; var inputs = [ { id: 'wheelDiameter', label: 'Wheel Diameter', min: 10, max: 30 }, { id: 'wheelWidth', label: 'Wheel Width', min: 4, max: 15 }, { id: 'tireWidth', label: 'Tire Width', min: 145, max: 350 }, { id: 'tireAspectRatio', label: 'Tire Aspect Ratio', min: 10, max: 90 }, { id: 'currentOffset', label: 'Current Offset', min: -50, max: 70 }, { id: 'newOffset', label: 'New Offset', min: -50, max: 70 } ]; inputs.forEach(function(input) { var element = document.getElementById(input.id); var errorElement = document.getElementById(input.id + 'Error'); var value = element.value.trim(); if (value === ") { errorElement.textContent = input.label + ' is required.'; errors = true; } else if (!isValidNumber(value)) { errorElement.textContent = input.label + ' must be a valid number.'; errors = true; } else { var numValue = parseFloat(value); if (numValue input.max) { errorElement.textContent = input.label + ' must be between ' + input.min + ' and ' + input.max + '.'; errors = true; } else { errorElement.textContent = "; // Clear error } } }); if (errors) { mainResultDiv.textContent = 'Invalid Inputs'; innerClearanceDiv.innerHTML = 'Inner Clearance Change: N/A'; outerClearanceDiv.innerHTML = 'Outer Clearance Change: N/A'; trackWidthChangeDiv.innerHTML = 'Track Width Change: N/A'; updateTable('N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'); updateChart(0, 0, 0, 0); return; } var wheelDiameter = parseFloat(wheelDiameterInput.value); var wheelWidth = parseFloat(wheelWidthInput.value); var tireWidth = parseFloat(tireWidthInput.value); var tireAspectRatio = parseFloat(tireAspectRatioInput.value); var currentOffset = parseFloat(currentOffsetInput.value); var newOffset = parseFloat(newOffsetInput.value); // Calculations var tireSectionHeightMM = tireWidth * (tireAspectRatio / 100); var tireDiameterInches = wheelDiameter + (2 * tireSectionHeightMM / 25.4); var wheelWidthMM = wheelWidth * 25.4; // Current Setup Dimensions var currentWheelHalfWidthIn = wheelWidth / 2; var currentBackspacingIn = currentWheelHalfWidthIn + (currentOffset / 25.4); var currentTireSidewallHeightIn = tireSectionHeightMM / 25.4; var currentTireOverallWidthIn = (currentTireWidthMM / 25.4) + (2 * currentTireSidewallHeightIn); var currentOuterEdgePosMM = (currentWheelWidthInches / 2) + currentOffset; // Position of outer edge relative to hub mount surface var currentInnerEdgePosMM = currentOuterEdgePosMM – currentWheelWidthMM; // Position of inner edge relative to hub mount surface // New Setup Dimensions var newWheelHalfWidthIn = wheelWidth / 2; // Assuming same wheel width for now, but should be dynamic if new wheel width is different var newBackspacingIn = newWheelHalfWidthIn + (newOffset / 25.4); var newTireSidewallHeightIn = tireSectionHeightMM / 25.4; // Assuming same tire size for clearance calc var newTireOverallWidthIn = (tireWidth / 25.4) + (2 * newTireSidewallHeightIn); var newOuterEdgePosMM = (wheelWidth / 2) + newOffset; // Position of outer edge relative to hub mount surface var newInnerEdgePosMM = newOuterEdgePosMM – wheelWidthMM; // Position of inner edge relative to hub mount surface // Clearance and Offset Calculations var clearanceChange = newOffset – currentOffset; var innerClearanceChange = -(newOffset – currentOffset); // New position – Old position for inner side var outerClearanceChange = (newOffset – currentOffset); // New position – Old position for outer side var trackWidthChange = 2 * (newOffset – currentOffset); // Update Results Display mainResultDiv.textContent = formatNumber(clearanceChange, 1) + ' mm'; innerClearanceDiv.innerHTML = 'Inner Clearance Change: ' + formatNumber(innerClearanceChange, 1) + ' mm'; outerClearanceDiv.innerHTML = 'Outer Clearance Change: ' + formatNumber(outerClearanceChange, 1) + ' mm'; trackWidthChangeDiv.innerHTML = 'Track Width Change: ' + formatNumber(trackWidthChange, 1) + ' mm'; // Update Table updateTable( formatNumber(wheelWidth, 1), // Current Wheel Width formatNumber(wheelWidth, 1), // New Wheel Width formatNumber(currentOffset, 1), formatNumber(newOffset, 1), formatNumber(tireWidth, 1), formatNumber(tireWidth, 1), formatNumber(tireDiameterInches, 1), formatNumber(tireDiameterInches, 1), formatNumber(currentWheelHalfWidthIn * 2 + tireWidth / 25.4, 1), // Current Overall Width formatNumber(wheelWidth + tireWidth / 25.4, 1), // New Overall Width (Simplified assuming same tire width) formatNumber(innerClearanceChange * -1, 1), // Current Inner Clearance (relative to suspension) formatNumber(outerClearanceChange * 1, 1) // Current Outer Clearance (relative to fender) ); // Update Chart Data updateChart( formatNumber(innerClearanceChange * -1, 1), // Display positive inner clearance for current setup formatNumber(innerClearanceChange * -1 + innerClearanceChange, 1), // New inner clearance formatNumber(outerClearanceChange * 1, 1), // Display positive outer clearance for current setup formatNumber(outerClearanceChange * 1 + outerClearanceChange, 1) // New outer clearance ); } function updateTable( currentWheelWidth, newWheelWidth, currentOffsetVal, newOffsetVal, currentTireWidthVal, newTireWidthVal, currentTireDiameterVal, newTireDiameterVal, currentOverallWidthVal, newOverallWidthVal, currentInnerClearanceVal, newInnerClearanceVal ) { currentWheelWidthTable.textContent = currentWheelWidth; newWheelWidthTable.textContent = newWheelWidth; currentOffsetTable.textContent = currentOffsetVal; newOffsetTable.textContent = newOffsetVal; currentTireWidthTable.textContent = currentTireWidthVal; newTireWidthTable.textContent = newTireWidthVal; currentTireDiameterTable.textContent = currentTireDiameterVal; newTireDiameterTable.textContent = newTireDiameterVal; currentOverallWidthTable.textContent = currentOverallWidthVal; newOverallWidthTable.textContent = newOverallWidthVal; currentInnerClearanceTable.textContent = formatNumber(currentInnerClearanceVal, 1) + " mm"; newInnerClearanceTable.textContent = formatNumber(newInnerClearanceVal, 1) + " mm"; currentOuterClearanceTable.textContent = formatNumber(currentOuterClearanceVal, 1) + " mm"; newOuterClearanceTable.textContent = formatNumber(newOuterClearanceVal, 1) + " mm"; trackWidthChangeTable.textContent = formatNumber(parseFloat(trackWidthChangeDiv.querySelector('span').textContent) / 2, 1) + " mm"; // Half the total change for one side } function resetCalculator() { wheelDiameterInput.value = "17"; wheelWidthInput.value = "8.5"; tireWidthInput.value = "245"; tireAspectRatioInput.value = "40"; currentOffsetInput.value = "35"; newOffsetInput.value = "25"; document.getElementById('wheelDiameterError').textContent = "; document.getElementById('wheelWidthError').textContent = "; document.getElementById('tireWidthError').textContent = "; document.getElementById('tireAspectRatioError').textContent = "; document.getElementById('currentOffsetError').textContent = "; document.getElementById('newOffsetError').textContent = "; calculateFitment(); } function copyResults() { var mainResultText = mainResultDiv.textContent; var innerResult = innerClearanceDiv.textContent.replace('Inner Clearance Change: ', "); var outerResult = outerClearanceDiv.textContent.replace('Outer Clearance Change: ', "); var trackWidthResult = trackWidthChangeDiv.textContent.replace('Track Width Change: ', "); var resultString = "— Tire & Wheel Offset Fitment Results —\n\n"; resultString += "Primary Fitment Difference: " + mainResultText + "\n"; resultString += "Inner Clearance Change: " + innerResult + "\n"; resultString += "Outer Clearance Change: " + outerResult + "\n"; resultString += "Track Width Change: " + trackWidthResult + "\n\n"; resultString += "— Key Assumptions & Inputs —\n"; resultString += "Wheel Diameter: " + wheelDiameterInput.value + " inches\n"; resultString += "Wheel Width: " + wheelWidthInput.value + " inches\n"; resultString += "Tire Width: " + tireWidthInput.value + " mm\n"; resultString += "Tire Aspect Ratio: " + tireAspectRatioInput.value + " %\n"; resultString += "Current Offset: " + currentOffsetInput.value + " mm\n"; resultString += "New Offset: " + newOffsetInput.value + " mm\n"; // Copy to clipboard var textArea = document.createElement("textarea"); textArea.value = resultString; textArea.style.position = "fixed"; textArea.style.left = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Copy failed!'; alert(msg); // Simple feedback } catch (err) { alert('Oops, unable to copy'); } document.body.removeChild(textArea); } function initializeChart() { chartCtx = document.getElementById('myChart').getContext('2d'); chart = new Chart(chartCtx, { type: 'bar', // Use bar for distinct comparisons data: { labels: ['Current', 'New'], datasets: [ { label: 'Inner Clearance (mm)', data: [0, 0], backgroundColor: 'rgba(0, 74, 153, 0.7)', // Primary color borderColor: 'rgba(0, 74, 153, 1)', borderWidth: 1 }, { label: 'Outer Clearance (mm)', data: [0, 0], backgroundColor: 'rgba(255, 193, 7, 0.7)', // Warning color borderColor: 'rgba(255, 193, 7, 1)', borderWidth: 1 } ] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Clearance (mm)' } } }, plugins: { title: { display: true, text: 'Comparison of Inner and Outer Clearances' }, legend: { display: false // Custom legend used below chart } } } }); } function toggleFaq(element) { var faqItem = element.parentElement; faqItem.classList.toggle('open'); } // Event Listeners document.getElementById('calculateBtn').addEventListener('click', calculateFitment); document.getElementById('resetBtn').addEventListener('click', resetCalculator); document.getElementById('copyBtn').addEventListener('click', copyResults); // Initial Calculation and Chart Setup window.onload = function() { initializeChart(); calculateFitment(); }; // Update calculation in real-time var inputFields = [wheelDiameterInput, wheelWidthInput, tireWidthInput, tireAspectRatioInput, currentOffsetInput, newOffsetInput]; inputFields.forEach(function(field) { field.addEventListener('input', calculateFitment); });

Leave a Comment