This paper evaluates the effects on profitability of biofuel production if biofuel producers would sell the waste heat from the production to a local district heating system. All analyses have been performed considering four different technology cases for biofuel production. Two technology cases include ethanol production which is followed by by-production of raw biogas. This biogas can be upgraded and sold as biofuel (the first technology case) or directly used for combined heat and power production (the second technology case). The third and the fourth technology cases are Fischer-Tropsch diesel and dimethyl ether production plants based on biomass gasification. Two different district heating price levels and two different future energy market scenarios were considered. The sensitivity analyses of the discount rate were performed as well.In the case of energy market conditions, the profitability depends above all on the price ratio between biomass (used as the feedstock for biofuel production) and crude oil (used as the feedstock for fossil diesel and gasoline production). The reason for this is that the gate biofuel prices (the prices on which the biofuel would be sold) were calculated assuming that the final prices at the filling stations are the same as the prices of the replaced fossil fuel. The price ratios between biomass and district heating, and between biomass and electricity, also have an influence on the profitability, since higher district heating and electricity prices lead to higher revenues from the heat/electricity by-produced.Due to high biofuel (ethanol + biogas) efficiency, the ethanol production plant which produces upgraded biogas has the lowest biofuel production costs. Those costs would be lower than the biofuel gate prices even if the support for transportation fuel produced from renewable energy sources were not included. If the raw biogas that is by-produced would instead be used directly for combined heat and power production, the revenues from the electricity and heat would increase, but at the same time the biofuel efficiency would be lower, which would lead to higher production costs. On the other hand, due to the fact that it has the highest heat efficiency compared to the other technologies, the ethanol production in this plant shows a high sensitivity to the district heating price level, and the economic benefit from introducing such a plant into a district heating system is most obvious. Assuming a low discount rate (6%), the introduction of such a plant into a district heating system would lead to between 28% and 52% (depending on the district heating price level and energy market scenario) lower biofuel production costs. Due to the lower revenues from the heat and electricity co-produced, and higher capital investments compared to the ethanol production plants, Fischer-Tropsch diesel and dimethyl ether productions are shown to be profitable only if high support for transportation fuel produced from renewable energy sources is included.The results also show that an increase of the discount rate from 6% to 10% does not have a significant influence on the biofuel production costs. Depending on the biofuel production plant, and on the energy market and district heating conditions, when the discount rate increases from 6% to 10%, the biofuel production costs increase within a range from 2.2% to 6.8%.