Toxins in food come from several distinct sources: bacteria growing in unsafe conditions, molds triggered by heat and drought, natural defense chemicals built into plants, heavy metals accumulating through the environment, and chemical compounds created by high-heat cooking. Some of these toxins exist in raw ingredients before you ever touch them, while others form during storage, preparation, or cooking. Understanding where they come from helps you avoid the most common risks.
Bacteria That Produce Toxins
Certain bacteria don’t just cause infection. They manufacture toxic substances as they grow, and those substances remain dangerous even after the bacteria themselves are killed. The most notorious example is the bacterium that causes botulism. It thrives in low-oxygen environments, which is exactly what happens inside a sealed jar or can. When improperly canned foods are stored at room temperature, dormant spores can germinate into active bacteria and release a potent neurotoxin. This is why home canning requires careful attention to acidity: the bacterium cannot grow below a pH of 4.6, so acidic foods like tomatoes, most fruits, and pickles can be safely processed in a water bath. Low-acid foods like vegetables and meats need pressure canning to reach temperatures high enough to destroy the spores.
Staphylococcus bacteria work differently. They produce toxins on food that’s been left at room temperature too long, and reheating won’t neutralize what they’ve already created. This is why the “danger zone” between roughly 40°F and 140°F matters so much for cooked food sitting out. The toxin is already in the food before you realize anything is wrong.
Mold and Mycotoxins
Molds are fungi that colonize grains, nuts, dried fruits, and spices, sometimes producing invisible toxic compounds called mycotoxins. The most dangerous of these are aflatoxins, produced by molds that commonly infect corn, peanuts, and tree nuts. What triggers toxin production is a specific combination of extreme heat and drought. Research on corn crops has shown that aflatoxin production spikes when daily maximum temperatures hit 95°F (35°C) or higher, combined with atmospheric drought where minimum relative humidity drops below 40%.
The optimal conditions for the mold to both grow and produce toxins are temperatures around 95–100°F with humidity above 85%. This makes aflatoxin contamination a particular problem in tropical and subtropical regions, and it’s becoming more common in temperate areas during heat waves. The FDA regulates aflatoxin levels in commercial products like peanuts and peanut butter, but the contamination happens in the field, long before food reaches a store shelf. You can’t see, smell, or taste aflatoxins, which is why regulatory testing matters and why visibly moldy nuts or grains should always be discarded entirely rather than trimmed.
Natural Toxins Built Into Plants
Many plants produce their own toxic compounds as a defense against insects and animals. These are completely natural, present in the raw ingredient, and in most cases rendered harmless by proper preparation.
Potatoes produce a compound called solanine, concentrated in the skin and especially in any green patches or sprouts. A dose of roughly 2.5 mg per kilogram of body weight causes nausea, abdominal cramps, vomiting, and diarrhea. At 6 mg per kilogram, outcomes can be fatal. For a 150-pound person, that fatal threshold is roughly 400 mg, which is hard to reach from normal potatoes but becomes plausible if you eat large quantities of heavily greened or sprouting ones. Cutting away green areas and sprouts removes most of the risk.
Cassava, a staple food for hundreds of millions of people, contains compounds that release cyanide when the plant’s cells are broken down. Varieties range from low-cyanide (under 50 micrograms per gram) to high-cyanide (over 100 micrograms per gram). Traditional processing methods, including peeling, soaking, boiling, and drying, reduce cyanide content by 25% to 98% depending on the technique. Thorough boiling and extended soaking are the most effective approaches.
Raw red kidney beans contain a lectin that causes severe nausea and vomiting within hours of eating. The WHO recommends soaking dried beans for at least 12 hours, then boiling vigorously for at least 10 minutes. The FDA goes further, recommending a 5-hour soak followed by 30 minutes of boiling to ensure complete destruction of the toxin. This is why slow cookers alone can be risky for dried kidney beans: they may not reach a high enough temperature to break down the lectin. A full rolling boil is essential.
Toxins Created by High-Heat Cooking
Some toxins don’t exist in food until you cook it. When starchy, carbohydrate-rich foods like potatoes, bread, or coffee beans are heated above 248°F (120°C) through frying, baking, or roasting, a chemical reaction between natural sugars and an amino acid creates acrylamide. This is the same browning reaction that gives toast its color and french fries their crust. The darker the browning, the more acrylamide is present. Potato chips, French fries, crispy baked goods, and coffee are the most significant dietary sources worldwide.
Grilling meat creates a different set of compounds. When fat and juices drip from meat onto a hot flame or coals, they burn incompletely and produce smoke that carries harmful chemicals back up onto the food’s surface. The hotter the fire and the more fat dripping, the more of these compounds deposit on the meat. Cooking with lower flames, trimming excess fat, using a drip pan, or simply reducing the time meat spends directly over an open flame all lower exposure.
Heavy Metals From the Environment
Mercury enters waterways primarily from industrial pollution and natural geological sources. Bacteria in water convert it to a form called methylmercury, which accumulates as it moves up the food chain. Small fish absorb small amounts; larger predatory fish that eat thousands of smaller fish over their lifetimes concentrate it to much higher levels.
The fish with the highest mercury concentrations, based on FDA testing, are tilefish from the Gulf of Mexico (averaging 1.123 parts per million), swordfish (0.995 ppm), and shark (0.979 ppm). King mackerel averages 0.73 ppm, and fresh bigeye tuna comes in at 0.689 ppm. For comparison, canned light tuna and salmon test far lower. The pattern is straightforward: the bigger and longer-lived the predatory fish, the more mercury it contains.
Arsenic and lead follow different pathways into food. Arsenic accumulates naturally in rice because rice paddies flood with water that draws arsenic from soil. The FDA has set action levels for inorganic arsenic in rice cereals for infants and in apple juice. Lead contamination in food intended for babies and young children is also actively regulated, with updated guidance issued as recently as January 2025. These metals don’t form during cooking. They’re absorbed by crops from soil and water during growth, making them harder to avoid through preparation alone.
How Storage Conditions Create Risk
Many food toxins are products of time and temperature. Bacterial toxins form when cooked food sits in the temperature danger zone too long. Mycotoxins develop when grains and nuts are stored in warm, humid conditions. Cyanide compounds in cassava are only dangerous when processing is insufficient. Even the botulism toxin requires room-temperature storage of improperly canned food to develop.
Cold storage slows or stops bacterial growth. Proper drying reduces the moisture that molds need to colonize grains. Acidifying canned foods below pH 4.6 prevents botulism spores from activating. Thorough boiling neutralizes plant lectins. In most cases, the toxin isn’t inevitable. It’s the result of a specific failure in how food was stored, processed, or prepared, which means most of these risks are preventable with the right handling.

