Primary energy use, emission and the cost of whole energy system chains, from natural resource to end-user, were analysed, in a Swedish context, when heating detached houses. Both electricity-based systems employing heat pumps, boilers, or resistance heaters, and local fuel-based systems (e.g. natural gas, oil and wood fuel) were considered. The base-load electricity was produced in stand-alone power plants using wood fuel or natural gas, while peak-load electricity and fuel used for transportation were produced from crude oil. The heat pump systems were most energy efficient, followed by the local fuel-based systems. Electricity production based on cogeneration instead of stand-alone power plants would improve the energy efficiency and reduce the cost of the electricity-based systems. The wood-fuel-based systems emitted about one tenth of the carbon dioxide emitted by the fossil-fuel systems. The acidic emission, however, was higher for wood-fuel-based systems, especially compared with natural gas. Primary energy use and emission from the recovery, production and transportation of fuels were limited compared with the primary energy use and emission for the whole energy system chains. Transportation of biofuels, for example, represented less than 1% of the primary energy use. The heat pump systems and the local boiler systems, excluding the pellet boiler system, exhibited the lowest cost. The cost of electricity-based systems, other than heat pump systems, was higher due to a lower overall conversion efficiency. The pellet boiler system exhibited almost as high cost as these electric-based systems. The difference in cost between the same type of wood-fuel- and fossil-fuel-based systems was less than 12%. All Swedish energy taxes and environmental fees were excluded in the cost calculations. The removal of carbon dioxide from the flue gases from large natural-gas-fired stand-alone power plants could reduce the carbon dioxide emission by about 70%. This will increase the primary energy use, the emission of other compounds and the cost. However, regarding heat pumps these increases are small due to the high coefficient of performance.