function calculateSpringRate() {
// 1. Get input values
var riderLbs = parseFloat(document.getElementById("riderWeight").value);
var bikeLbs = parseFloat(document.getElementById("bikeWeight").value);
var travelMm = parseFloat(document.getElementById("forkTravel").value);
var sagPercent = parseFloat(document.getElementById("targetSag").value);
var biasPercent = parseFloat(document.getElementById("weightBias").value);
var preloadMm = parseFloat(document.getElementById("preloadEstimate").value);
// 2. Validate inputs
if (isNaN(riderLbs) || isNaN(bikeLbs) || isNaN(travelMm) || isNaN(sagPercent) || isNaN(biasPercent)) {
alert("Please fill in all required fields with valid numbers.");
return;
}
if (travelMm <= 0 || sagPercent <= 0) {
alert("Travel and Sag Percentage must be greater than zero.");
return;
}
// 3. Calculation Logic
// Convert weights to KG
var riderKg = riderLbs * 0.453592;
var bikeKg = bikeLbs * 0.453592;
var totalSystemWeightKg = riderKg + bikeKg;
// Calculate load on the front axle based on weight bias
var frontAxleLoadKg = totalSystemWeightKg * (biasPercent / 100);
// Calculate load per fork leg (assuming 2 legs)
var loadPerLegKg = frontAxleLoadKg / 2;
// Calculate the physical compression required at equilibrium (Ride Height)
// Sag is the amount the suspension compresses from full extension under load.
var targetSagMm = travelMm * (sagPercent / 100);
// The spring force equation is F = k * x
// x (total spring compression) = Target Sag + Preload
// Preload is the mechanical compression applied before the rider sits on it.
// We assume the spring must support the loadPerLegKg when compressed to (Sag + Preload).
var totalCompressionMm = targetSagMm + preloadMm;
// Avoid division by zero
if (totalCompressionMm === 0) {
totalCompressionMm = 1;
}
// Calculate Spring Rate (k) = F / x
// Result in kg/mm
var rateKg = loadPerLegKg / totalCompressionMm;
// Conversions
// 1 kg/mm = 9.80665 N/mm
var rateN = rateKg * 9.80665;
// 1 kg/mm = 55.997 lbs/in
var rateLbs = rateKg * 55.997;
// 4. Display Results
document.getElementById("rateKgMm").innerText = rateKg.toFixed(2) + " kg/mm";
document.getElementById("rateNMm").innerText = rateN.toFixed(2) + " N/mm";
document.getElementById("rateLbsIn").innerText = rateLbs.toFixed(1) + " lbs/in";
document.getElementById("calcSagMm").innerText = Math.round(targetSagMm) + " mm";
// Show result box
document.getElementById("resultBox").style.display = "block";
}
Understanding Fork Spring Rates
Finding the correct fork spring rate is the foundational step in suspension tuning for motorcycles and mountain bikes. The spring rate determines how much force is required to compress the fork a specific distance. If your springs are too soft, the bike will dive excessively under braking and bottom out on jumps. If they are too stiff, the ride will feel harsh, deflection will occur on small bumps, and you won't utilize your full suspension travel.
Definition: Spring Rate refers to the stiffness of the spring, typically measured in kg/mm (kilograms per millimeter) or N/mm (Newtons per millimeter). A 0.48 kg/mm spring requires 0.48kg of force to compress it by 1mm.
How This Calculator Works
This calculator estimates the ideal linear spring rate based on a physics model of static equilibrium. Here is a breakdown of the inputs used:
Rider Weight: This must include all your gear (helmet, boots, hydration pack). A typical motocross gear setup adds 15-20 lbs to your body weight.
Weight Bias: Motorcycles are not perfectly balanced 50/50. Most dirt bikes carry slightly less weight on the front (approx 48%), while street bikes may vary. This bias determines how much of the total mass the front springs must support.
Target Sag: This is the percentage of suspension travel used just by the weight of the bike and rider. For motocross, 25-30% is standard. For street/track, it might be roughly 30-35mm of total travel.
Preload: Springs are installed with a small amount of mechanical compression (preload) to ensure they don't rattle and to set the initial ride height. This calculation accounts for that initial tension.
Interpreting Your Results
The result provided is the spring rate per fork leg, assuming a conventional setup with two springs (one in each leg). If you have a single-spring fork (common in some air-fork conversions or mountain bikes), you would double the result.
Metric vs. Imperial
kg/mm: The standard for most Japanese and European suspension manufacturers (Showa, KYB, WP usually uses N/mm).
N/mm: The scientific standard, often used by WP Suspension (KTM/Husqvarna).
lbs/in: Frequently used in American markets or older suspension documentation.
Next Steps
Once you have your calculated rate, compare it to the stock springs in your bike. If the calculated rate is more than one "step" (usually 0.02 kg/mm increments) away from your current springs, you will likely benefit significantly from an upgrade. Remember that this calculator provides a theoretical baseline; aggressive riders or Supercross tracks may require stiffer rates than calculated, while trail riders might prefer slightly softer rates for comfort.