A fern is a member of a group of vascular plants that reproduce via spores and have neither seeds nor flowers. They differ from mosses by being vascular, i.e., having specialized tissues that conduct water and nutrients and in having life cycles in which the sporophyte is the dominant phase. Ferns first appear in the fossil record about 360 million years ago in the middle Devonian period, but many of the current families and species did not appear until roughly 145 million years ago in the early Cretaceous, after flowering plants came to dominate many environments. The fern Osmunda claytoniana is a paramount example of evolutionary stasis; paleontological evidence indicates it has remained unchanged, even at the level of fossilized nuclei and chromosomes, for at least 180 million years. Like the sporophytes of seed plants, those of ferns consist of stems, leaves and roots. Ferns differ from seed plants in reproducing by spores and from bryophytes in that, like seed plants, they are Polysporangiophytes, their sporophytes branching and producing many sporangia. Unlike bryophytes, fern sporophytes are free-living and only briefly dependent on the maternal gametophyte.
Fern species live in a wide variety of habitats, from remote mountain elevations, to dry desert rock faces, bodies of water or open fields. Ferns in general may be thought of as largely being specialists in marginal habitats, often succeeding in places where various environmental factors limit the success of flowering plants. Some ferns are among the world's most serious weed species, including the bracken fern growing in the Scottish highlands, or the mosquito fern (Azolla) growing in tropical lakes, both species forming large aggressively spreading colonies. There are four particular types of habitats that ferns are found in: moist, shady forests; crevices in rock faces, especially when sheltered from the full sun; acid wetlands including bogs and swamps; and tropical trees, where many species are epiphytes (something like a quarter to a third of all fern species). Ferns are vascular plants differing from lycophytes by having true leaves (megaphylls), which are often pinnate. They differ from seed plants (gymnosperms and angiosperms) in reproducing by means of spores and they lack flowers and seeds. Like all land plants, they have a life cycle referred to as alternation of generations, characterized by alternating diploid sporophytic and haploid gametophytic phases. The diploid sporophyte has 2n paired chromosomes, where n varies from species to species. The haploid gametophyte has n unpaired chromosomes, i.e. half the number of the sporophyte. The gametophyte of ferns is a free-living organism, whereas the gametophyte of the gymnosperms and angiosperms is dependent on the sporophyte. Ferns are not as important economically as seed plants, but have considerable importance in some societies. Some ferns are used for food, including the fiddleheads of Pteridium aquilinum (bracken), Matteuccia struthiopteris (ostrich fern), and Osmundastrum cinnamomeum (cinnamon fern). Diplazium esculentum is also used in the tropics (for example in budu pakis, a traditional dish of Brunei) as food. Tubers from the "para", Ptisana salicina (king fern) are a traditional food in New Zealand and the South Pacific. Fern tubers were used for food 30,000 years ago in Europe. Fern tubers were used by the Guanches to make gofio in the Canary Islands. Ferns are generally not known to be poisonous to humans. Licorice fern rhizomes were chewed by the natives of the Pacific Northwest for their flavor.