Mycetophilidae is a family of small flies, forming the bulk of those species known as fungus gnats. There are approximately 3000 described species in 150 genera but the true number of species is undoubtedly much higher. They are generally found in the damp habitats favoured by their host fungi and sometimes form dense swarms.
Adults of this family can usually be separated from other small flies by the strongly humped thorax, well-developed coxae and often spinose legs but identification within the family between genera and species generally requires close study of microscopic features such as subtle differences in wing venation, variation in chaetotaxy and genitalia. The terrestriallarvae usually feed on fungi, especially the fruiting bodies but also spores and hyphae, but some species have been recorded on mosses and liverworts. The larvae of some species, while still being associated with fungi, are at least partly predatory.
Around a dozen mycetophilid species are unique among flies in displaying bioluminescence. In some species this is restricted to the larval stage but in others this feature is retained by the pupae and adults. It has been suggested that the ability to produce their own light is used by some predatory larvae as a lure for potential prey, although it also obviously makes themselves more susceptible to predation or parasitism. These are not mycetophilids sensu stricto, but belong to the family Keroplatidae.
Some 800 species (including some of the bioluminescent species) have been split into a separate family by Tuomikoski in 1966, Keroplatidae. This split is not universally recognized as yet and many sources still include the keroplatid genera within Mycetophilidae. Other recent families, included here in Mycetophilidae as they are not recognized by all workers are Ditomyiidae, Lygistorrhinidae, Diadocidiidae and Rangomaramidae. The Mycetophilidae sensu lato contain about 330 described genera. These include :