Adult human testicle with epididymis: A. Head of epididymis, B. Body of epididymis, C. Tail of epididymis, and D. Vas deferens
The epididymis (; plural: epididymides or ) is a tube that connects a testicle to a vas deferens in the male reproductive system. It is present in all male reptiles, birds, and mammals. It is a single, narrow, tightly-coiled tube in adult humans, 6 to 7 meters (20 to 23 ft) in length connecting the efferent ducts from the rear of each testicle to its vas deferens.
The epididymis can be divided into three main regions:
In reptiles, there is an additional canal between the testis and the head of the epididymis and which receives the various efferent ducts. This is, however, absent in all birds and mammals.
The epididymis is covered by a two layered pseudostratified epithelium. The epithelium is separated by a basement membrane from the connective tissue wall which has smooth muscle cells. The major cell types in the epithelium are:
The stereocilia of the epididymis are long cytoplasmic projections that have an actin filament backbone. These filaments have been visualized at high resolution using fluorescent phalloidin that binds to actin filaments.  The stereocilia in the epididymis are non-motile. These membrane extensions increase the surface area of the cell, allowing for greater absorption and secretion. It has been shown that epithelial sodium channel ENaC that allows the flow of Na+ ions into the cell is localized on stereocilia.
Because sperm are initially non-motile as they leave the seminiferous tubules, large volumes of fluid are secreted to propel them to the epididymis. The core function of the stereocilia is to resorb 90% of this fluid as the spermatozoa start to become motile. This absorption creates a fluid current that moves the immobile sperm from the seminiferous tubules to the epididymis. Spermatozoa do not reach full motility until they reach the vagina, where the alkaline pH is neutralized by acidic vaginal fluids.
In the embryo, the epididymis develops from tissue that once formed the mesonephros, a primitive kidney found in many aquatic vertebrates. Persistence of the cranial end of the mesonephric duct will leave behind a remnant called the appendix of the epididymis. In addition, some mesonephric tubules can persist as the paradidymis, a small body caudal to the efferent ductules.
Spermatozoa formed in the testis enter the caput epididymis, progress to the corpus, and finally reach the cauda region, where they are stored. Sperm entering the caput epididymis are incomplete--they lack the ability to swim forward (motility) and to fertilize an egg. Epididymal transit takes 2 to 6 days in humans and 10-13 in rodents.  During their transit in the epididymis, sperm undergo maturation processes necessary for them to acquire motility and fertility. Final maturation (capacitation) is completed in the female reproductive tract.
The epididymis secretes an intraluminal environment that suppresses sperm motility until ejaculation.
During ejaculation, sperm flow from the cauda epididymis (which functions as a storage reservoir) into the vas deferens where they are propelled by the peristaltic action of muscle layers in the wall of the vas deferens, and are mixed with the diluting fluids of the prostate, seminal vesicles, and other accessory glands prior to ejaculation (forming semen).
Epididymotomy is the placing of an incision into the epididymis and is sometimes considered as a treatment option for acute suppurating epididymitis. Epididymectomy is the surgical removal of the epididymis sometimes performed for post-vasectomy pain syndrome and for refractory cases of epididymitis.
Epididymectomy is also performed for sterilization on some male animals, but it is not 100% effective due to the fact that the remaining reproductive tubing can regenerate and reattach to each other, thus restoring this male animal's fertility.