.calculator-container {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.calc-header {
text-align: center;
margin-bottom: 25px;
border-bottom: 2px solid #0056b3;
padding-bottom: 10px;
}
.calc-header h2 {
margin: 0;
color: #333;
}
.calc-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
@media (max-width: 600px) {
.calc-grid {
grid-template-columns: 1fr;
}
}
.input-group {
margin-bottom: 15px;
}
.input-group label {
display: block;
margin-bottom: 5px;
font-weight: 600;
color: #555;
}
.input-group input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
}
.input-group .currency-wrap {
position: relative;
}
.input-group .currency-wrap span {
position: absolute;
left: 10px;
top: 10px;
color: #777;
}
.input-group .currency-wrap input {
padding-left: 25px;
}
.btn-calc {
background-color: #0056b3;
color: white;
padding: 15px 30px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 18px;
width: 100%;
margin-top: 10px;
transition: background 0.3s;
}
.btn-calc:hover {
background-color: #004494;
}
.results-section {
margin-top: 30px;
background-color: #f8f9fa;
padding: 20px;
border-radius: 8px;
display: none;
border-left: 5px solid #28a745;
}
.result-row {
display: flex;
justify-content: space-between;
padding: 10px 0;
border-bottom: 1px solid #e9ecef;
}
.result-row:last-child {
border-bottom: none;
}
.result-label {
font-weight: 600;
color: #333;
}
.result-value {
font-weight: 700;
color: #0056b3;
}
.highlight-result {
font-size: 1.2em;
color: #28a745;
}
.calc-article {
margin-top: 40px;
line-height: 1.6;
color: #333;
}
.calc-article h3 {
color: #0056b3;
margin-top: 25px;
}
.calc-article ul {
padding-left: 20px;
}
.calc-article li {
margin-bottom: 8px;
}
Base Carrier Cost (Linehaul):
$0.00
Total Carrier Pay (All-in):
$0.00
Broker Gross Profit:
$0.00
Quote to Shipper (Total):
$0.00
Shipper Rate Per Mile:
$0.00
How to Calculate Freight Rates and Margins
In the logistics industry, accuracy is profit. Whether you are a freight broker, a dispatcher, or an owner-operator, understanding how to construct a rate is essential for maintaining healthy margins and winning bids. This calculator helps determine the final "All-in" rate to quote a shipper based on the cost of the truck and your desired profit margin.
The Formulas Used
Freight pricing generally starts with the Carrier Cost (what you pay the truck) and adds a percentage Margin to determine the Shipper Rate (what you charge the customer). Note that Margin is different from Markup.
1. Calculate Carrier Cost:
(Miles × Rate Per Mile) + Accessorials = Total Carrier Pay
2. Calculate Shipper Quote (Using Margin):
Total Carrier Pay / (1 – (Margin % / 100)) = Quote to Shipper
Example: If you pay a truck $1,000 and want a 20% margin: $1,000 / (1 – 0.20) = $1,250. Your profit is $250.
Key Terminology
- RPM (Rate Per Mile): The standard unit of pricing in trucking. It fluctuates based on fuel costs, lane supply/demand, and equipment type (Reefer, Flatbed, Dry Van).
- Accessorials: Additional fees for services beyond standard driving, such as Tarping (for flatbeds), Detention (waiting time), Lumpers (loading/unloading assistance), or Stop-off charges.
- Margin vs. Markup: This calculator uses Margin (Profit divided by Revenue), which is the industry standard for brokerage KPIs. A 15% margin yields a higher price than a 15% markup.
Tips for Accurate Quoting
Always verify the current market RPM using load boards or index tools before quoting. Rates can change daily based on seasonality (e.g., produce season) and capacity. Additionally, ensure your "All-in" quote to the shipper includes the Fuel Surcharge (FSC) if it is not broken out separately in your contract.
function calculateFreightRate() {
// Get Input Values
var miles = document.getElementById('fb_miles').value;
var rpm = document.getElementById('fb_rpm').value;
var accessorials = document.getElementById('fb_accessorials').value;
var margin = document.getElementById('fb_margin').value;
// Parse inputs
var milesVal = parseFloat(miles);
var rpmVal = parseFloat(rpm);
var extrasVal = parseFloat(accessorials);
var marginVal = parseFloat(margin);
// Default extras to 0 if empty
if (isNaN(extrasVal)) {
extrasVal = 0;
}
// Validation
if (isNaN(milesVal) || milesVal <= 0) {
alert("Please enter a valid distance in miles.");
return;
}
if (isNaN(rpmVal) || rpmVal < 0) {
alert("Please enter a valid Rate Per Mile.");
return;
}
if (isNaN(marginVal) || marginVal = 100) {
alert("Please enter a valid margin percentage (between 0 and 99).");
return;
}
// Calculations
// 1. Carrier Base Cost (Linehaul)
var carrierBase = milesVal * rpmVal;
// 2. Total Carrier Cost (including extras)
var carrierTotal = carrierBase + extrasVal;
// 3. Quote to Shipper (Price based on Margin)
// Formula: Cost / (1 – Margin%)
// If margin is 0, price = cost
var shipperQuote = 0;
if (marginVal === 0) {
shipperQuote = carrierTotal;
} else {
shipperQuote = carrierTotal / (1 – (marginVal / 100));
}
// 4. Broker Profit
var profit = shipperQuote – carrierTotal;
// 5. Shipper Rate Per Mile (Total Quote / Miles)
var shipperRPM = shipperQuote / milesVal;
// Display Results
document.getElementById('res_carrier_base').innerHTML = "$" + carrierBase.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('res_carrier_total').innerHTML = "$" + carrierTotal.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('res_profit').innerHTML = "$" + profit.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('res_shipper_quote').innerHTML = "$" + shipperQuote.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('res_shipper_rpm').innerHTML = "$" + shipperRPM.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
// Show results section
document.getElementById('fb_result_area').style.display = "block";
}