The best way to calculate how much it costs for each mile that you drive is to use an online vehicle cost calculator. The two main ways to figure cost include calculating direct cost only or considering indirect as well as direct costs.
Calculating direct cost per mile involves keeping accurate fuel, maintenance, insurance and licensing records and choosing a formula for factoring in the purchase price of the vehicle. The best way to keep vehicle records is with a small notebook in the glove box and scrupulous attention to keeping it up to date. Don't forget to add in parking fees, tolls, fines and accident deductibles.
To figure in the purchase price, establish your period of ownership for the vehicle, then subtract any resale or trade-in value remaining at the end of that period from the initial cost. Dividing that adjusted purchase cost number by the number of miles driven during the ownership period breaks down the purchase cost to a per-mile basis. An alternate way to calculate purchase cost per mile is to add a depreciation figure to the above calculation by using an online depreciation calculator, such as the one at Money-Zine.com.
Calculating full indirect costs is much more complicated as it includes a holistic accounting of all costs associated with driving including taxes for road construction and many other factors. See online calculator at CommuteSolutions.org for a look at indirect costs.