Cockroaches (or simply "roaches") are insects of the order Blattaria. This name derives from the Latin word for "cockroach", blatta.
There are about 4,000 species of cockroach of which 30 species are associated with human habitations and about four species are well known as pests.
Among the best-known pest species are the American cockroach, Periplaneta americana, which is about 30 millimetres (1.2 in) long, the German cockroach, Blattella germanica, about 15 millimetres (½ in) long, the Asian cockroach, Blattella asahinai, also about 15 millimetres (½ in) in length, and the Oriental cockroach, Blatta orientalis, about 25 millimetres (1 in). Tropical cockroaches are often much bigger, and extinct cockroach relatives such as the Carboniferous Archimylacris and the Permian Apthoroblattina were several times as large as these.

Historically, the name Blattaria has been used largely interchangeably with the name Blattodea, though in most recent treatments, the latter name refers to a larger grouping that includes numerous fossil groups that were related to roaches, but not true cockroaches themselves. Another name, Blattoptera has come into use for this same paraphyletic group. These earliest cockroach-like fossils ("Blattopterans" or "roachids") are from the Carboniferous period between 354–295 million years ago. However, these fossils differ from modern cockroaches in having long ovipositors and are the ancestors of mantids as well as modern cockroaches. The first fossils of modern cockroaches with internal ovipositors appear in the early Cretaceous.
Cockroaches live in a wide range of environments around the world. Pest species of cockroaches adapt readily to a variety of environments, but prefer warm conditions found within buildings. Many tropical species prefer even warmer environments and do not fare well in the average household.
The spines on the legs were earlier considered to be sensory, but observations of their locomotion on sand and wire meshes has demonstrated that they help in locomotion on difficult terrain. The structures have been used as inspiration for robotic legs.
Cockroaches leave chemical trails in their feces as well as emitting airborne pheromones for swarming and mating. Other cockroaches will follow these trails to discover sources of food and water, and also discover where other cockroaches are hiding. Thus, cockroaches can exhibit emergent behavior, in which group or swarm behavior emerges from a simple set of individual interactions.
Research has shown that group-based decision-making is responsible for complex behavior such as resource allocation. In a study where 50 cockroaches were placed in a dish with three shelters with a capacity for 40 insects in each, the insects arranged themselves in two shelters with 25 insects in each, leaving the third shelter empty. When the capacity of the shelters was increased to more than 40 insects per shelter, all of the cockroaches arranged themselves in one shelter. Researchers found a balance between cooperation and competition exists in group decision-making behavior found in cockroaches. The models used in this research can also explain the group dynamics of other insects and animals.
Cockroaches are mainly nocturnal and will run away when exposed to light. A peculiar exception is the Asian cockroach, which is attracted to light. Another study tested the hypothesis that cockroaches use just two pieces of information to decide where to go under those conditions: how dark it is and how many of their friends are there. The study conducted by José Halloy and colleagues at the Free University of Brussels and other European institutions created a set of tiny robots that to the roaches appear to be other roaches and can thus alter the roaches' perception of critical mass. The robots were also specially scented so that they would be accepted by the real roaches.
Additionally, researchers at Tohoku University engaged in a Classical Conditioning experiment with cockroaches and discovered that the insects were able to associate the scent of vanilla and peppermint with a sugar treat.
Cockroaches, like all insects, breathe through a system of tubes called tracheae. The tracheae of insects are attached to the spiracles, excluding the head. Thus cockroaches, like all insects, are not dependent on the mouth and windpipe to breathe. The valves open when the CO2 level in the insect rises to a high level; then the CO2 diffuses out of the tracheae to the outside and fresh O2 diffuses in. Unlike in vertebrates that depend on blood for transporting O2 and CO2, the tracheal system brings the air directly to cells, the tracheal tubes branching continually like a tree until their finest divisions, tracheoles, are associated with each cell, allowing gaseous oxygen to dissolve in the cytoplasm lying across the fine cuticle lining of the tracheole. CO2 diffuses out of the cell into the tracheole.
While cockroaches do not have lungs and thus do not actively breathe in the vertebrate lung manner, in some very large species the body musculature may contract rhythmically to forcibly move air out and in the spiracles; this may be considered a form of breathing.
Female cockroaches are sometimes seen carrying egg cases on the end of their abdomen; the egg case of the German cockroach holds about 30–40 long, thin eggs, packed like frankfurters in the case called an ootheca. The eggs hatch from the combined pressure of the hatchlings gulping air and are initially bright white nymphs that continue inflating themselves with air and harden and darken within about four hours. Their transient white stage while hatching and later while molting has led to many claims of glimpses of an albino cockroach.
A female German cockroach carries an egg capsule containing around 40 eggs. She drops the capsule prior to hatching, though live births do rarely occur. Development from eggs to adults takes 3-4 months. Cockroaches live up to a year. The female may produce up to eight egg cases in a lifetime; in favorable conditions, it can produce 300-400 offspring. Other species of cockroach, however, can produce an extremely high number of eggs in a lifetime, but in some cases a female only needs to be impregnated once to be able to lay eggs for the rest of her life.
It is popularly suggested that cockroaches will "inherit the earth" if humanity destroys itself in a nuclear war. Cockroaches do indeed have a much higher radiation resistance than vertebrates, with the lethal dose perhaps 6 to 15 times that for humans. However, they are not exceptionally radiation-resistant compared to other insects, such as the fruit fly.
The cockroach's ability to withstand radiation better than human beings can be explained in terms of the cell cycle. Cells are most vulnerable to the effects of radiation when they are dividing. A cockroach's cells divide only once each time it molts, which is weekly at most in a juvenile roach. Since not all cockroaches would be molting at the same time, many would be unaffected by an acute burst of radiation, but lingering radioactive fallout would still be harmful.
General preventative measures against household pests include keeping all food stored away in sealed containers, using garbage cans with a tight lid, frequent cleaning in the kitchen, and regular vacuuming. Any water leaks, such as dripping taps, should also be repaired. It is also helpful to seal off any entry points, such as holes around baseboards, in between kitchen cabinets, pipes, doors, and windows with some steel wool or copper mesh and some cement, putty or silicone caulk.
American cockroaches have been known to live up to three months without food and a month without water. Frequently living outdoors, although preferring warm climates and considered "cold intolerant," they are resilient enough to survive occasional freezing temperatures. This makes them difficult to eradicate once they have infested an area.
There are numerous parasites and predators of cockroaches, but few of them have proven to be highly effective for biological control. Wasps in the family Evaniidae are perhaps the most effective insect predators, as they attack the egg cases, and wasps in the family Ampulicidae are predators on adult and nymphal cockroaches (e.g., Ampulex compressa). The house centipede is probably the most effective control agent of cockroaches, though many homeowners find the centipedes themselves objectionable.
Bait stations, gels containing hydramethylnon or fipronil, as well as boric acid powder, are toxic to cockroaches. Baits with egg killers are also quite effective at reducing the cockroach population. Additionally, pest control products containing deltamethrin or pyrethrin are very effective.
In Singapore and Malaysia, taxi drivers use Pandan leaves as a cockroach repellent in their vehicles. In Russia, some people, after opening all cupboards, leave a saucepan half-full of sulfur burning on a gas ring, then quickly come back in to switch it off (with gas mask) and leave the residence for a few days. This is said to be protective for ten years.
Recently, a method called the Vegas roach trap has gained popularity as a successful way to control a cockroach infestation.
Some of the earliest writings with regards to cockroaches encouraged their use as medicine. Pedanius Dioscorides (1st century), Kamal al-Din al-Damiri and Abu Hanifa ad-Dainuri (9th century) all offered medicines that either suggest grinding them up with oil or boiling them. The list of ailments to be treated included earaches, open wounds and "gynecological disorders."
Pest control is cited as one of the reasons for reduced populations of cockroaches in ex-USSR countries.
Not all depictions of cockroaches are purely negative, however. In the film Joe's Apartment, the cockroaches help the titular hero, and the narrator of the book archy and mehitabel is a sympathetic cockroach. In the book Revolt of the Cockroach People, an autobiographical novel by Oscar Zeta Acosta, cockroaches are used as a metaphor for oppressed and downtrodden minorities in US society in the 1960s and 70s. The image of cockroaches as resilient also leads people to compare themselves to cockroaches. Madonna has famously quoted, "I am a survivor. I am like a cockroach, you just can't get rid of me. "Cockroach", or some variant of it is also used as a nickname, for example Boxing coach Freddie Roach, who was nicknamed La Cucaracha (The Cockroach) when he was still competing as a fighter.