Every fuel uses the same simple idea: take the price of one unit of energy and divide by the distance that unit carries you. The energy unit cancels, leaving pure rupees per kilometre — which is exactly what makes the four fuels directly comparable:
costPerKmPetrol = petrolPrice (₹/L) ÷ mileagePetrol (km/L)
costPerKmE20 = petrolPrice (₹/L) ÷ [ mileagePetrol × (1 − drop%/100) ]
costPerKmCng = cngPrice (₹/kg) ÷ mileageCng (km/kg)
costPerKmEv = evTariff (₹/kWh) ÷ efficiencyEv (km/kWh)
monthlyCost = costPerKm × monthlyKm
annualCost = monthlyCost × 12
The unit that trips everyone up is CNG. Petrol and E20 are dispensed and priced per litre, and electricity per kilowatt-hour — but CNG is a compressed gas, so it is metered by mass and priced per kilogram (₹/kg), not per litre. Your CNG mileage is therefore in km/kg, and ₹/kg ÷ km/kg still cancels cleanly to ₹/km. Entering a CNG price as if it were per litre is the single most common way to get this comparison wrong.
E20 is the other subtlety: it is pumped at the same per-litre price as petrol, but because ethanol carries only about 65% of petrol’s volumetric energy (IEA-AMF), a litre of E20 takes you slightly less far. The calculator applies a mileage penalty (default 3.5%, per MoPNG) to petrol economy, so E20 always costs a touch more per km than pure petrol at the same pump price. To model that efficiency penalty on its own — extra litres and extra rupees per month for your specific car — use the dedicated E20 mileage impact calculator, which turns the efficiency drop into your monthly extra fuel cost.
At typical Indian prices an EV runs at roughly one-fifth the per-km cost of petrol, and CNG about a third cheaper than petrol — but the winner flips if your electricity tariff is high or your CNG mileage is poor. Because it is unit arithmetic, the ranking is only as good as the prices you enter, so use your own city’s rates.