.calculator-container {
font-family: sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 8px;
background-color: #f9f9f9;
}
.calculator-inputs {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
margin-bottom: 20px;
}
.input-group {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 5px;
font-weight: bold;
color: #333;
}
input[type="number"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
}
button {
grid-column: 1 / -1;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
.calculator-results {
margin-top: 20px;
padding: 15px;
border: 1px dashed #007bff;
border-radius: 4px;
background-color: #e7f3ff;
text-align: center;
font-size: 18px;
color: #0056b3;
min-height: 50px; /* Ensure it has some height even when empty */
display: flex;
align-items: center;
justify-content: center;
}
function calculateSpringRate() {
var riderWeight = parseFloat(document.getElementById("riderWeight").value);
var bikeWeight = parseFloat(document.getElementById("bikeWeight").value);
var sagPercentage = parseFloat(document.getElementById("sagPercentage").value);
var shockStroke = parseFloat(document.getElementById("shockStroke").value);
var shockShaftDiameter = parseFloat(document.getElementById("shockShaftDiameter").value);
var resultDiv = document.getElementById("result");
// Input validation
if (isNaN(riderWeight) || isNaN(bikeWeight) || isNaN(sagPercentage) || isNaN(shockStroke) || isNaN(shockShaftDiameter)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (riderWeight <= 0 || bikeWeight <= 0 || sagPercentage = 100 || shockStroke <= 0 || shockShaftDiameter <= 0) {
resultDiv.innerHTML = "Please enter positive values, and sag between 1% and 99%.";
return;
}
// Constants and conversions
var g = 9.81; // Acceleration due to gravity (m/s^2)
var pi = Math.PI;
// Convert weights from kg to Newtons (Force)
var totalWeightInNewtons = (riderWeight + bikeWeight) * g;
// Calculate the desired sag in mm
var desiredSagInMm = shockStroke * (sagPercentage / 100);
// Calculate the spring rate (N/mm)
// Spring Rate (k) = Force (F) / Displacement (x)
// Force is the total weight supported by the shock.
// Displacement is the amount the shock compresses due to that weight.
var springRateNPerMm = totalWeightInNewtons / desiredSagInMm;
// Convert to lbs/in for common MTB units
var N_to_lbs = 0.224809;
var mm_to_in = 0.0393701;
var springRateLbsPerInch = springRateNPerMm * (N_to_lbs / mm_to_in);
// Format the output
var formattedSpringRateNPerMm = springRateNPerMm.toFixed(2);
var formattedSpringRateLbsPerInch = springRateLbsPerInch.toFixed(2);
resultDiv.innerHTML = "Recommended Spring Rate: " + formattedSpringRateNPerMm + " N/mm (" + formattedSpringRateLbsPerInch + " lbs/in)";
}
## Understanding and Calculating Your MTB Spring Rate
Setting up your mountain bike's suspension correctly is crucial for optimal performance, comfort, and control on the trail. One of the most important adjustments you can make is to dial in the correct spring rate for your rear shock. The spring rate determines how much the shock compresses under your weight and the bike's weight, directly influencing how the suspension feels and reacts to impacts.
### What is Spring Rate?
In the context of mountain biking suspension, the spring rate refers to the stiffness of the spring. It's typically measured in Newtons per millimeter (N/mm) or pounds per inch (lbs/in). A higher spring rate means a stiffer spring that requires more force to compress, while a lower spring rate indicates a softer spring.
### Why is the Correct Spring Rate Important?
* **Sag:** The primary goal when setting spring rate is to achieve the correct "sag." Sag is the amount your suspension compresses when you are sitting on the bike in your normal riding position.
* **Suspension Performance:** Too soft a spring will cause excessive sag, leading to bottoming out frequently, a wallowy feel, and reduced pedaling efficiency. Too stiff a spring will result in insufficient sag, making the suspension ride high, harsh, and unable to absorb small bumps effectively.
* **Control and Comfort:** Proper sag ensures your suspension is actively working throughout its travel, providing grip, comfort, and confidence on varied terrain.
### How to Calculate Your Recommended Spring Rate
This calculator helps you determine a good starting point for your rear shock's spring rate. It takes into account your weight, the bike's weight, the desired sag percentage, and the dimensions of your shock.
**Inputs Explained:**
* **Rider Weight (kg):** Your body weight in kilograms. Be honest and include any gear you typically wear (backpack, hydration pack, etc.).
* **Bike Weight (kg):** The approximate weight of your mountain bike. You can usually find this in your bike's specifications.
* **Rider Sag Percentage (%):** This is the percentage of the shock's total travel that you want to compress under your riding weight. A common starting point for many mountain bikes is 25% for trail and enduro, and sometimes up to 30-35% for downhill. Consult your bike manufacturer's recommendations if available.
* **Shock Stroke (mm):** The total travel of your rear shock in millimeters. This is the maximum distance the shock shaft can move. You can usually find this in your bike's or shock's specifications.
* **Shock Shaft Diameter (mm):** The diameter of the shock's shaft. While not directly used in the basic spring rate calculation (which focuses on force vs. displacement), it's a parameter related to shock design and can be relevant for more advanced suspension tuning or specific shock types. For this calculator, it's included as a common spec.
**The Calculation:**
1. **Total Weight:** We first sum your weight and the bike's weight.
2. **Total Force:** This total weight is converted into a force (in Newtons) by multiplying by the acceleration due to gravity (g = 9.81 m/s²).
3. **Desired Sag:** The desired sag percentage is applied to the shock's stroke to determine the target compression distance in millimeters.
4. **Spring Rate (N/mm):** The spring rate is calculated by dividing the total force by the desired sag distance. This gives you the stiffness required to achieve that sag.
5. **Conversion to lbs/in:** The result is also converted to the more commonly used unit in the US, pounds per inch (lbs/in), for easier comparison with aftermarket springs.
**Example:**
Let's say you weigh **80 kg**, your bike weighs **16 kg**, you're aiming for **25% sag**, your shock stroke is **65 mm**, and the shock shaft diameter is **11 mm**.
* Total Weight = 80 kg + 16 kg = 96 kg
* Total Force = 96 kg \* 9.81 m/s² = 941.76 N
* Desired Sag = 65 mm \* (25 / 100) = 16.25 mm
* Spring Rate (N/mm) = 941.76 N / 16.25 mm ≈ 57.95 N/mm
* Spring Rate (lbs/in) ≈ 57.95 N/mm \* (0.224809 lbs/N / 0.0393701 in/mm) ≈ 331 lbs/in
Therefore, a starting point spring rate of approximately **58 N/mm (331 lbs/in)** would be recommended.
### Fine-Tuning and Next Steps
This calculator provides a *starting point*. Always fine-tune your suspension on the trail. After setting your initial spring rate, check your sag. Then, go for a ride and pay attention to how the suspension performs.
* **Too harsh?** Consider a slightly softer spring.
* **Bottoming out too easily or feeling wallowy?** Consider a stiffer spring.
Remember that damping settings also play a critical role in how your suspension feels and performs. Once your spring rate is dialed in, experiment with your rebound and compression damping adjustments.