A virus is a small infectious agent that replicates only inside the living cells of an organism. Viruses can infect all types of life forms, from animals and plants to microorganisms, including bacteria and archaea.
Viruses are found in almost every ecosystem on Earth and are the most numerous type of biological entity. The study of viruses is known as virology, a sub-speciality of microbiology. While not inside an infected cell or in the process of infecting a cell, viruses exist in the form of independent particles, or virions, consisting of: the genetic material, i.e. long molecules of DNA or RNA that encode the structure of the proteins by which the virus acts; a protein coat, the capsid, which surrounds and protects the genetic material; and in some cases an outside envelope of lipids. The shapes of these virus particles range from simple helical and icosahedral forms to more complex structures. Most virus species have virions too small to be seen with an optical microscope, about one hundredth the size of most bacteria.
The origins of viruses in the evolutionary history of life are unclear: some may have evolved from plasmids—pieces of DNA that can move between cells—while others may have evolved from bacteria. In evolution, viruses are an important means of horizontal gene transfer, which increases genetic diversity in a way analogous to sexual reproduction. Viruses are considered by some to be a life form, because they carry genetic material, reproduce, and evolve through natural selection, although they lack key characteristics (such as cell structure) that are generally considered necessary to count as life. Because they possess some but not all such qualities, viruses have been described as "organisms at the edge of life",and as replicators.