:root {
–primary-color: #2c3e50;
–accent-color: #3498db;
–light-bg: #f8f9fa;
–border-color: #dee2e6;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.calculator-container {
background: #fff;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
margin-bottom: 40px;
border: 1px solid var(–border-color);
}
.calc-title {
text-align: center;
color: var(–primary-color);
margin-bottom: 25px;
font-size: 24px;
font-weight: 700;
}
.input-group {
margin-bottom: 20px;
}
.input-row {
display: flex;
gap: 20px;
margin-bottom: 15px;
flex-wrap: wrap;
}
.input-col {
flex: 1;
min-width: 200px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: var(–primary-color);
}
input[type="number"], input[type="text"] {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
}
.checkbox-group {
display: flex;
align-items: center;
gap: 10px;
background: var(–light-bg);
padding: 10px;
border-radius: 4px;
border: 1px solid var(–border-color);
}
input[type="checkbox"] {
width: 20px;
height: 20px;
cursor: pointer;
}
button.calc-btn {
background-color: var(–accent-color);
color: white;
padding: 15px 30px;
border: none;
border-radius: 4px;
cursor: pointer;
width: 100%;
font-size: 18px;
font-weight: bold;
transition: background-color 0.3s;
}
button.calc-btn:hover {
background-color: #2980b9;
}
#result-area {
margin-top: 25px;
padding: 20px;
background-color: var(–light-bg);
border-radius: 4px;
display: none;
border-left: 5px solid var(–accent-color);
}
.result-row {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
font-size: 16px;
}
.result-total {
margin-top: 15px;
padding-top: 15px;
border-top: 2px solid #ddd;
font-size: 20px;
font-weight: bold;
color: var(–primary-color);
display: flex;
justify-content: space-between;
}
.article-content h2 {
color: var(–primary-color);
margin-top: 30px;
border-bottom: 2px solid var(–light-bg);
padding-bottom: 10px;
}
.article-content ul {
background: var(–light-bg);
padding: 20px 40px;
border-radius: 8px;
}
.article-content li {
margin-bottom: 10px;
}
.info-tooltip {
font-size: 0.85em;
color: #666;
margin-top: 4px;
}
function calculatePerDiem() {
// Get inputs
var lodgingRate = parseFloat(document.getElementById('lodgingRate').value);
var lodgingNights = parseInt(document.getElementById('lodgingNights').value);
var mealRate = parseFloat(document.getElementById('mealRate').value);
var mealDays = parseInt(document.getElementById('mealDays').value);
var useGsaRule = document.getElementById('gsaRule').checked;
// Validation
if (isNaN(lodgingRate)) lodgingRate = 0;
if (isNaN(lodgingNights)) lodgingNights = 0;
if (isNaN(mealRate)) mealRate = 0;
if (isNaN(mealDays)) mealDays = 0;
// Calculate Lodging (Simple multiplication)
var totalLodging = lodgingRate * lodgingNights;
// Calculate Meals (M&IE)
var totalMeals = 0;
if (useGsaRule && mealDays > 0) {
if (mealDays === 1) {
// Only one day of travel
totalMeals = mealRate * 0.75;
} else {
// First and last day are 75%, middle days are 100%
var fullDays = mealDays – 2;
var partialDays = 2; // First and last
totalMeals = (fullDays * mealRate) + (partialDays * mealRate * 0.75);
}
document.getElementById('adjustmentRow').style.display = 'block';
} else {
totalMeals = mealRate * mealDays;
document.getElementById('adjustmentRow').style.display = 'none';
}
var grandTotal = totalLodging + totalMeals;
// Display Results
document.getElementById('displayLodging').innerHTML = '$' + totalLodging.toFixed(2);
document.getElementById('displayMeals').innerHTML = '$' + totalMeals.toFixed(2);
document.getElementById('displayTotal').innerHTML = '$' + grandTotal.toFixed(2);
document.getElementById('result-area').style.display = 'block';
}
How Do You Calculate Per Diem Rate?
Calculating per diem rates is an essential process for businesses managing travel expenses and for employees ensuring they receive fair reimbursement. "Per diem" is Latin for "by the day," and it represents a daily allowance given to employees to cover costs such as lodging, meals, and incidental expenses (M&IE) while traveling for work.
The Basic Per Diem Formula
At its core, the total per diem reimbursement is calculated by adding the lodging allowance to the meal allowance for the duration of the trip. However, strict rules usually apply to how these days are counted.
Total Reimbursement = (Daily Lodging Rate × Nights) + (Daily M&IE Rate × Days)
Understanding the Components
- Lodging Rate: This covers the cost of overnight accommodation (hotel, motel, apartment rental). It is calculated based on the number of nights stayed, not the number of days.
- M&IE Rate (Meals & Incidental Expenses): This covers breakfast, lunch, dinner, and small fees (like tips for baggage carriers). This is calculated based on the number of days the employee is on status.
The 75% Rule (GSA Standard)
One of the most critical aspects of calculating per diem correctly is handling the first and last day of travel. The U.S. General Services Administration (GSA), which sets the standard for federal and many corporate travel policies, uses the 75% Rule.
On the day you depart and the day you return, you do not receive the full M&IE rate. Instead, you receive 75% of the daily allowance, regardless of what time your travel begins or ends. The full rate is only applied to full days spent entirely at the destination.
Example Calculation
Imagine an employee travels to a city with a Per Diem rate of $150 for Lodging and $64 for M&IE for a 3-day trip (2 nights).
- Lodging: $150 × 2 nights = $300
- Meals (Day 1 – Travel Day): $64 × 0.75 = $48
- Meals (Day 2 – Full Day): $64 × 1.00 = $64
- Meals (Day 3 – Return Day): $64 × 0.75 = $48
- Total Reimbursement: $300 + $48 + $64 + $48 = $460
How to Find Your Rate
Rates vary significantly by location and time of year. Before using the calculator above, you should determine the allowable rate for your specific destination. In the United States, these rates are established by:
- GSA (General Services Administration): For destinations within the continental U.S. (CONUS).
- Department of State: For foreign rates (OCONUS).
- Department of Defense: For non-foreign overseas areas (like Alaska, Hawaii, Puerto Rico).
Per Diem vs. Actual Expenses
Companies may choose to reimburse "actual expenses" rather than a flat per diem. In the actual expense method, employees must submit receipts for every meal and hotel charge. The per diem method simplifies accounting by eliminating the need for meal receipts, provided the reimbursement does not exceed the federal rate.