Electric fencing is increasingly used as a tool for elephant (Loxodonta africana) conservation in human-dominated landscapes and there are few empirical studies to demonstrate that electrified barriers are effective in deterring elephants from raiding crops. The factors determining the effectiveness of electric fences are not fully understood. We assessed the performance of Namelok and Kimana fences in reducing human–elephant conflict by comparing the frequency of crop-raiding by elephants and the perceptions of farmers on the effect of the fences in reducing elephant crop-raiding within fenced and adjacent unfenced farmlands. We also examined the effect of intact fence wires, presence of current and amount of voltage on fence breakage by elephants. Electric fencing reduced elephant crop-raiding and other forms of human–elephant conflicts. Namelok fence was not broken by elephants whereas Kimana fence was broken several times probably because it borders Kimana Sanctuary which provided cover where elephants could retreat after crop-raiding. The mere presence of current did not minimize fence breakage by elephants. Elephants entered fenced areas more frequently when the fence wires were broken than when wires were intact. Our results suggest that, location of fences in relation to landscape factors, maintenance of effective non-electrified fences and proximity of fences to areas of high elephant concentration are significant determinants of fence performance in mitigating elephant crop-raiding.