An electric fish is any fish that can generate electric fields, whether to sense things around them, for defence, or to stun prey. Most fish able to produce shocks are also electroreceptive, meaning that they can sense electric fields. The only exception is the stargazer family (Uranoscopidae). Electric fish, although a small minority of all fishes, include both oceanic and freshwater species, and both cartilaginous and bony fishes.
Electric fish produce their electrical fields from an electric organ. This is made up of electrocytes, modified muscle or nerve cells, specialized for producing strong electric fields, used to locate prey, for defence against predators, and for signalling, such as in courtship. Electric organ discharges are two types, pulse and wave, and vary both by species and by function.
Electric fish have evolved many specialised behaviours. The predatory African sharptooth catfish eavesdrops on its weakly electric mormyrid prey to locate it when hunting, driving the prey fish to develop electric signals that are harder to detect. Bluntnose knifefishes produce an electric discharge pattern similar to the electrolocation pattern of the dangerous electric eel, probably a form of Batesian mimicry to dissuade predators. Glass knifefish that are using similar frequencies move their frequencies up or down in a jamming avoidance response; African knifefish have convergently evolved a nearly identical mechanism.