An electric fence is a barrier that uses electric shocks to deter animals and people from crossing a boundary. The voltage of the shock may have effects ranging from discomfort to death. Electric fences are used for agricultural fencing and other forms of animal control.