The three main cost components
Material cost is usually the largest single component for desktop FDM printing. Filament is priced per kilogram, so cost scales directly with how many grams the slicer estimates for the print. Most slicers report filament weight after slicing; this is the value to enter.
Energy cost is relatively small for typical hobby printing — a 200W printer running for four hours uses 0.8 kWh, which at US average rates of about $0.15/kWh costs roughly $0.12. For longer prints or high-power printers, energy becomes more significant.
Maintenance and depreciation accounts for the cost of the printer spread across its useful life, plus wear items like nozzles, build plates, and lubricants. A simple estimate is $0.05–$0.25 per hour depending on the printer and how heavily it is used.
Material cost = Weight (g) / 1000 × Price per kg
Converts slicer gram estimate to kilograms for pricing.
Energy cost = Printer watts × Print hours / 1000 × Electricity rate ($/kWh)
Energy used in kilowatt-hours multiplied by the local electricity rate.