Business
Medical / Moving (Qualified)
Charitable Organizations
Applicable Rate:–
Estimated Tax Deduction:–
function calculateDeduction() {
// 1. Get input elements exactly by ID
var yearInput = document.getElementById("mil_taxYear");
var purposeInput = document.getElementById("mil_purpose");
var milesInput = document.getElementById("mil_miles");
var resultBox = document.getElementById("mil_result_box");
var displayRate = document.getElementById("mil_display_rate");
var finalAmount = document.getElementById("mil_final_amount");
var noteText = document.getElementById("mil_note_text");
// 2. Parse values
var year = yearInput.value;
var purpose = purposeInput.value;
var miles = parseFloat(milesInput.value);
// 3. Validation
if (isNaN(miles) || miles < 0) {
alert("Please enter a valid number of miles.");
return;
}
// 4. Define Rates logic (cents per mile)
var rate = 0;
// 2024 Rates
if (year === "2024") {
if (purpose === "business") {
rate = 0.67; // 67 cents
} else if (purpose === "medical") {
rate = 0.21; // 21 cents
} else if (purpose === "charity") {
rate = 0.14; // 14 cents
}
}
// 2023 Rates
else if (year === "2023") {
if (purpose === "business") {
rate = 0.655; // 65.5 cents
} else if (purpose === "medical") {
rate = 0.22; // 22 cents
} else if (purpose === "charity") {
rate = 0.14; // 14 cents
}
}
// 5. Calculate Total
var totalDeduction = miles * rate;
// 6. Formatting
// Convert rate to cents text for display
var rateText = (rate * 100).toFixed(1).replace('.0', '') + "¢ per mile";
// Format currency
var currencyFormatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
// 7. Update DOM
displayRate.innerHTML = rateText;
finalAmount.innerHTML = currencyFormatter.format(totalDeduction);
// Add specific notes based on selection
if (purpose === "medical") {
noteText.innerHTML = "*Note: Moving expenses are currently only deductible for active-duty members of the Armed Forces pursuant to a military order.";
} else if (purpose === "charity") {
noteText.innerHTML = "*Note: The charitable rate is set by statute and does not adjust for inflation like business rates.";
} else {
noteText.innerHTML = "*Based on the standard mileage rate method.";
}
// Show result box
resultBox.style.display = "block";
}
Understanding the Current IRS Mileage Rates
The Internal Revenue Service (IRS) updates the standard mileage rates annually. These rates are used to calculate the deductible costs of operating an automobile for business, charitable, medical, or moving purposes. Understanding the current rates is crucial for freelancers, small business owners, and gig workers (like Uber or Lyft drivers) to maximize their tax deductions.
2024 vs. 2023 Mileage Rates
The rates often change due to fluctuations in fuel prices and vehicle maintenance costs. Below is a comparison of the rates used in our calculator:
For Business Drives
2024: 67 cents per mile (up 1.5 cents from 2023).
2023: 65.5 cents per mile.
For Medical & Moving (Qualified Military)
2024: 21 cents per mile.
2023: 22 cents per mile.
For Charitable Service
2024 & 2023: 14 cents per mile. (This rate is fixed by Congress and rarely changes).
How to Calculate Your Deduction
Using the standard mileage rate simplifies tax filing because you do not need to track actual expenses like gas, insurance, repairs, and depreciation. Instead, you track your mileage and multiply it by the applicable rate.
Example Calculation:
If you drove 1,000 miles for business purposes in 2024:
Formula: Miles Driven × Rate per Mile
Calculation: 1,000 × $0.67
Total Deduction: $670.00
Record-Keeping Requirements
To claim this deduction, the IRS requires timely and accurate records. You cannot simply estimate your mileage at the end of the year. A compliant mileage log must include:
The date of the trip.
The starting point and destination.
The business purpose of the trip.
The total miles driven for that specific trip.
The total reading on the odometer at the start and end of the year.
Standard Rate vs. Actual Expenses
Taxpayers generally have the option to use the standard mileage rate or the "actual expense" method. The actual expense method requires you to track every penny spent on the vehicle (gas, oil, tires, insurance, registration, etc.) and multiply that by the percentage of business use. While the standard mileage rate is easier, the actual expense method might yield a higher deduction if you drive an expensive vehicle with high operating costs or low fuel efficiency.