Truckload Rate Calculator
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background-color: #f4f7f6;
}
.calculator-container {
background: #ffffff;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
padding: 30px;
margin-bottom: 40px;
}
.calc-header {
text-align: center;
margin-bottom: 30px;
color: #2c3e50;
}
.calc-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
}
@media (max-width: 768px) {
.calc-grid {
grid-template-columns: 1fr;
}
}
.input-group {
margin-bottom: 20px;
}
.input-group label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #555;
}
.input-group input {
width: 100%;
padding: 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
}
.input-group input:focus {
border-color: #3498db;
outline: none;
box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}
.btn-calc {
background-color: #2980b9;
color: white;
border: none;
padding: 15px 30px;
font-size: 18px;
font-weight: bold;
border-radius: 4px;
cursor: pointer;
width: 100%;
transition: background-color 0.2s;
margin-top: 10px;
}
.btn-calc:hover {
background-color: #1c5980;
}
.results-section {
background-color: #f8f9fa;
padding: 25px;
border-radius: 6px;
border: 1px solid #e9ecef;
}
.result-row {
display: flex;
justify-content: space-between;
padding: 12px 0;
border-bottom: 1px solid #e0e0e0;
}
.result-row:last-child {
border-bottom: none;
}
.result-label {
color: #666;
}
.result-value {
font-weight: bold;
font-size: 18px;
color: #2c3e50;
}
.result-total {
background-color: #e8f4fc;
padding: 15px;
border-radius: 4px;
margin-top: 15px;
border-left: 5px solid #3498db;
}
.result-total .result-value {
font-size: 24px;
color: #2980b9;
}
.content-section {
background: #fff;
padding: 40px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
h2 { color: #2c3e50; margin-top: 0; }
h3 { color: #34495e; margin-top: 25px; }
p { margin-bottom: 15px; }
ul { margin-bottom: 15px; padding-left: 20px; }
li { margin-bottom: 8px; }
Rate Breakdown
Base Freight Cost:
$0.00
Fuel Surcharge (Total):
$0.00
Fuel Cost per Mile:
$0.00
Accessorials:
$0.00
Total All-In Rate:
$0.00
All-In Rate Per Mile:
$0.00
Understanding Truckload Rate Calculations
Calculating an accurate truckload rate is essential for carriers to ensure profitability and for shippers to budget effectively. In the logistics industry, the "All-In Rate" is composed of several variables, primarily the base linehaul rate, fuel surcharges (FSC), and accessorial fees.
Key Components of a Freight Rate
- Base Rate per Mile (RPM): This is the core cost of moving the freight, covering the driver's wages, truck maintenance, insurance, and the carrier's operating margin. It fluctuates based on supply and demand in specific lanes (e.g., Headhaul vs. Backhaul).
- Fuel Surcharge (FSC): Since diesel prices fluctuate, carriers charge a fuel surcharge to protect themselves from rising costs. This calculator determines FSC dynamically based on the current price of diesel, the truck's fuel efficiency (MPG), and the total distance.
- Accessorials: These are additional flat fees for services beyond standard driving. Common examples include detention (waiting time), lumper fees (loading/unloading assistance), tarping (for flatbeds), and stop-off charges.
How to Use This Calculator
This tool allows owner-operators, fleet managers, and freight brokers to quickly estimate the total cost of a lane. Here is how the math works:
- Mileage: Input the total paid miles for the trip (e.g., from PC Miler or Google Maps).
- Base Rate: Enter the negotiated linehaul rate per mile excluding fuel.
- Fuel Dynamics: Input the current national or regional average diesel price and the truck's average MPG (Miles Per Gallon). The formula (Fuel Price ÷ MPG) × Miles gives the total fuel cost/surcharge required to break even on fuel.
- All-In Analysis: The calculator sums up the base cost, calculated fuel cost, and extra fees to provide a "Total All-In Rate" and converts that back into an "All-In Rate Per Mile" for easy comparison against market averages like DAT or Truckstop.com.
Why "All-In Rate Per Mile" Matters
While the total gross amount of a load looks attractive, the rate per mile is the true indicator of a load's profitability. An owner-operator typically needs to earn above a specific cost-per-mile threshold (often between $1.80 and $2.50 depending on equipment) to cover fixed and variable costs. Using this calculator helps ensure that a quote covers not just the fuel, but the truck payment, maintenance, and driver salary.
function calculateTruckloadRate() {
// 1. Get Input Values
var miles = document.getElementById('tl_miles').value;
var baseRate = document.getElementById('tl_base_rate').value;
var fuelPrice = document.getElementById('tl_fuel_price').value;
var mpg = document.getElementById('tl_mpg').value;
var accessorials = document.getElementById('tl_accessorials').value;
// 2. Validate Inputs
if (miles === "" || miles <= 0) {
alert("Please enter a valid trip distance in miles.");
return;
}
if (baseRate === "" || baseRate < 0) {
alert("Please enter a valid base rate per mile.");
return;
}
if (fuelPrice === "" || fuelPrice < 0) {
alert("Please enter the current fuel price.");
return;
}
if (mpg === "" || mpg <= 0) {
alert("Please enter a valid MPG (Miles Per Gallon).");
return;
}
// Parse values to floats
miles = parseFloat(miles);
baseRate = parseFloat(baseRate);
fuelPrice = parseFloat(fuelPrice);
mpg = parseFloat(mpg);
accessorials = accessorials === "" ? 0 : parseFloat(accessorials);
// 3. Perform Calculations
// Calculate Base Linehaul Cost
var baseCost = miles * baseRate;
// Calculate Fuel Cost per Mile (Fuel component of the rate)
var fuelCostPerMile = fuelPrice / mpg;
// Calculate Total Fuel Cost for the trip
var totalFuelSurcharge = miles * fuelCostPerMile;
// Calculate Grand Total (All-In)
var totalRate = baseCost + totalFuelSurcharge + accessorials;
// Calculate All-In Rate Per Mile
var allInPerMile = totalRate / miles;
// 4. Update the DOM with Results
document.getElementById('res_base_cost').innerText = "$" + baseCost.toFixed(2);
document.getElementById('res_fsc_total').innerText = "$" + totalFuelSurcharge.toFixed(2);
document.getElementById('res_fuel_cpm').innerText = "$" + fuelCostPerMile.toFixed(3) + " / mi";
document.getElementById('res_accessorials').innerText = "$" + accessorials.toFixed(2);
document.getElementById('res_total_rate').innerText = "$" + totalRate.toFixed(2);
document.getElementById('res_all_in_rpm').innerText = "$" + allInPerMile.toFixed(2) + " / mi";
}