autocosts – car costs calculator
This calculator allows users to find the true cost of owning a car. It will normally give them a good estimate of what they really need to spend on car ownership. As car payments and expenses come due throughout the year, it's often difficult to really get a good understanding of total spending on a car. This calculator also provides to the user, optionally, the car's full Financial Effort considering the user's income, further providing also optionally the equivalent public transport costs (bus, train, UBER, etc.), considering the user doesn't own a car.
Try it on your machine
- Clone the project
git clone https://github.com/jfoclpf/autocosts.git
- Enter the newly created directory and install dependencies
cd autocosts/ && npm i --production
- Start the server
it will open a http local server which you can access through
The list of available countries
The translations are in corresponding
json files, namely in the folder
The list of available countries is from the file
World statistics of Car Costs
How does it work?
handlebarsjs to supply a server application that renders a car costs calculator as a webpage loaded by any common browser.
The project is optimized for a web-based version, and for an APP developped in Apache Cordova. The 2 last letters on the URI stands for the 2-letter ISO country code, and not for the language, since for example United Kingdom and Australia have the same language but different realities concerning the taxes, the terms applied to automobile costs and the units for fuel efficiency. The translations/language files apply therefore only to the selected country.
The project already considers all the units and fuel efficiency cases, different in many countries. The variations for fuel efficiency are
mpg(imp) and for distance are
mil (Nordic mile=10km). More information can be found in the directory
- Standing costs
- Car taxes
- Car finance
- Running costs
- Repairs and Improvements
- Car washes
For more information see
Autocosts supports the following additional services, which can be enabled or disabled (default).
After building with
node build.js, run
node bin/server.js -h for more information.
Autocosts also supports code such that the user inputs might be stored into a
mysql database. With the data from said database, it is also possible to make several statisitcal analysis, namely the average costs for each country, said statistical analysis having outlier removal techniques, such that such outliers do not distort the average.
Autocosts may use the UBER API, such that at the final repport, the user calculations can be compared with the equivalents costs if the user would use just UBER or combined with public transports.
Autocosts also allows the final report to be printed into a PDF report. It makes use of
pdfmake npm package.
The credentials for the above services are in the JSON files stored in
Install the api
npm i autocosts
Now use the autocosts api
const autocosts =// see// for standard units and time periodsvar userData =countryCode: 'US'currency: 'USD'depreciation:dateOfAcquisition:month: 5year: 2001valueOfTheVehicle: 25000dateOfUserInput:month: 2year: 2020valueOfTheVehicle: 5000insurance:amountPerPeriod: 200period: 'month'credit:creditBool: trueyesCredit:borrowedAmount: 15000numberInstallments: 48amountInstallment: 350residualValue: 0inspection:averageInspectionCost: 120numberOfInspections: 15roadTaxes:amountPerYear: 120// Form Part 2fuel:typeOfCalculation: 'distance' // type string: "money" or "distance"currencyBased:amountPerPeriod: nullperiod: null // type string: "month", "twoMonths", "trimester", "semester", "year"distanceBased:considerCarToJob: true // booleancarToJob:daysPerWeek: 5distanceBetweenHomeAndJob: 15distanceDuringWeekends: 30distanceStandardUnit: 'mi' // standard distance for current country: "km", "mil" or "mil(10km)"noCarToJob:distancePerPeriod: nullperiod: null // type string: "month", "twoMonths", "trimester", "semester", "year"distanceStandardUnit: null // type string: "km", "mil" or "mil(10km)"fuelEfficiency: 25 // fuel efficiency of the vehiclefuelEfficiencyStandard: 'mpg(US)' // type string; "ltr/100km", "mpg(US)", etc.fuelPrice: 25 // type number; currency per unit of volume standard. Ex: 1.4, that is 1.4 EUR / ltrfuelPriceVolumeStandard: 'gal(US)' // type string: 'ltr', 'gal(UK)', 'gal(US)'maintenance:amountPerYear: 700repairsImprovements:amountPerYear: 200parking:amountPerMonth: 14tolls:calculationBasedOnDay: true // true or falseyesBasedOnDay:amountPerDay: 25daysPerMonth: 22noBasedOnDay:amountPerPeriod: nullperiod: null // type string: "month", "twoMonths", "trimester", "semester", "year"fines:amountPerPeriod: 40period: 'year' // type string: "month", "twoMonths", "trimester", "semester", "year"washing:amountPerPeriod: 110period: 'year' // type string: "month", "twoMonths", "trimester", "semester", "year"var results = autocostsconsole
results will be the following:
The financial effort of the user and alternative costs considering public transports, uber and taxis included, are also optionally calculated. See the standard
userData object for more information.
This calculator is and shall always be completely anonymous, as it doesn't request nor permanently store, any name, email, cookies, IP address nor any other personal information.