Abstract In the absence of solar radiation, precipitating electrons from the solar wind (SW) are generally thought to be the dominant source of energy deposition in the nightside Martian upper atmosphere, creating a patchy ionosphere and possibly also affecting the nightside thermal budget of various neutral and ionized species. Previous model calculations have not taken into account in situ heating via SW electron impact. In the present study, we utilize extensive measurements made by several instruments on board the Mars Atmosphere and Volatile Evolution spacecraft, in order to perform data-driven computations of the nightside neutral, ion, and electron heating rates. Considering the large range of energetic electron intensity observed on the nightside of Mars, we divide the entire data set into two subsamples, either with or without energetic electron depletion, a notable feature of the nightside Martian ionosphere. Our calculations indicate that in situ nightside neutral heating is dominated by exothermic chemistry and Maxwell interaction with thermal ions for regions with depletion, and by direct SW impact for regions without. Collisional quenching of excited state species produced from a variety of channels, such as electron impact excitation, dissociation, and ionization, as well as dissociative recombination, makes a substantial contribution to neutral heating, except during depletion. For comparison, nightside ion heating is mainly driven by energetic ion production under all circumstances, which occurs mainly via ion-neutral reaction O+ + CO2 and CO2 + predissociation.