Enter how much heat you need and the energy prices, and this compares the cost of producing it with a gas boiler against a direct electric heater. Electricity is far dearer per unit, which is why it usually costs more even though electric heaters are nearly 100% efficient.
A unit of gas is much cheaper than a unit of electricity, so even though a gas boiler wastes some heat up the flue and an electric heater wastes almost none, gas heating still works out cheaper per unit of warmth for most homes. The exception is a heat pump, which is electric but multiplies each unit several times over; compare that with the heat pump running cost calculator. For room-by-room electric heating costs see electric radiator running cost and the heating guides.
Common questions
Is gas or electric heating cheaper?
Gas is usually cheaper. Under the current cap, gas is about 7.33p per kWh against 26.11p for electricity, so even allowing for a gas boiler being around 90% efficient, the same heat costs roughly three times more from a direct electric heater.
Are electric heaters 100% efficient?
Effectively yes, every watt becomes heat in the room. But efficiency is not the same as cost: the electricity itself is so much dearer per unit that an efficient electric heater still costs more to run than a less efficient gas boiler.