Foundations · Article 28

Food Safety for Home Bakers

The oven is a kill step, and most finished baked goods are too dry or too sweet for bacteria to grow in. The risk sits where the oven doesn't reach: the dough someone tasted, the meringue that never got hot, the custard pie left on the counter, and the people at the table who are more vulnerable than the baker.

US food-safety rules are written in Fahrenheit, so every regulatory figure here leads with °F and gives °C in parentheses. The consumer rules from USDA, FDA and CDC use 40 °F (4 °C) for the refrigerator and 2 hours at room temperature. The FDA Food Code’s 41 °F and its time limits apply to food businesses, and they’re in Production, Food Safety & Business.

Home baking is low-risk next to most cooking. A loaf of bread or a tray of cookies comes out of an oven hot enough to destroy the bacteria that matter, and what’s left is usually too dry or too sweet to support new growth. So the useful question isn’t whether baking is safe. It’s where the oven doesn’t do its job: what gets eaten before it bakes, what barely gets cooked, what sits out after it cools, and who is eating it.

Who is at higher risk

FDA and USDA’s Food Safety and Inspection Service (FSIS) name infants and young children, older adults, pregnant women and people with weakened immune systems as most at risk from Salmonella in eggs (FDA, 2024; FSIS, 2024). CDC lists pregnant women, newborns, people 65 and older and people with weakened immune systems as at higher risk from Listeria (CDC, 2025b). The federal advice to use pasteurized eggs in anything served raw or undercooked applies to everyone (FDA, 2024; FSIS, 2024). For these groups the stakes are higher, and two further precautions become the default: a cheesecake made with pasteurized eggs or baked to 160 °F (71 °C) at the center, and pasteurized whites even for a baked meringue topping. CDC advises higher-risk eaters to avoid raw milk and cheese made from it, and to eat queso fresco-type and raw-milk cheeses only when heated to 165 °F (74 °C) or until steaming hot (CDC, 2025b); use pasteurized milk, cream and cheese in fillings that won’t be baked.

Two rules hold for everyone. Don’t give honey, or anything made with it, to a child under 1 (CDC, 2026). That includes a honey cake for a first birthday, because spores of Clostridium botulinum can take hold in an infant’s gut. And don’t bake, frost or pack food for other people while you have vomiting or diarrhea, or for at least 48 hours after it stops. Wash with soap and water; hand sanitizer doesn’t work well against norovirus (CDC, 2025a). Hands matter for frosting and filling too, because nothing cooks them after you make them: a 2010 outbreak of Staphylococcus aureus with 100 illnesses was traced to bare-hand contact with a bakery’s cream cake, fillings and frostings (Blakeslee et al., 2020). Wash first, cover cuts, and use a spatula or piping bag rather than your fingers.

Raw flour, dough and batter

Flour is a raw food

Flour looks like a processed ingredient, but nothing in milling is designed to kill bacteria. FDA’s guidance says flour “hasn’t been treated to kill any bacteria” it may contain, that grain can pick up bacteria in the field or during milling, and that grinding grain into flour doesn’t kill them; the pathogens it names are Salmonella and E. coli (FDA, 2023). A review of the wheat chain lists animal activity, water, soil and manure before harvest, and storage, pests and unclean equipment after it (Doddabematti Prakash et al., 2025).

Dryness keeps those bacteria from multiplying, but it also keeps them alive. In flour stored at 73 °F (23 °C), enterohemorrhagic E. coli and Salmonella were still detectable when the experiments ended, at 168 and 365 days (Forghani et al., 2019), and a review puts their survival in flour and grain at up to two years (Rivera et al., 2025). Low moisture also makes Salmonella much harder to kill with heat (Liu et al., 2018), which is why toasting dry flour isn’t the same as baking a moist dough. Sprouted flours and seed powders are raw in the same way: organic sprouted chia powder caused a 2014 Salmonella outbreak with 31 illnesses in 16 states (CDC, 2014). Don’t stir them into no-bake treats unless the label says they’re treated to be eaten raw.

The outbreaks

In 2016, investigators traced 56 cases of Shiga toxin-producing E. coli (STEC) in 24 states to flour from one large producer. Illness was linked to using that brand and to tasting unbaked homemade dough or batter, the outbreak strains were isolated from the flour, and genome sequencing matched them to the patients (Crowe et al., 2017). In 2022 and 2023, a Salmonella Infantis outbreak made 14 people ill in 13 states, 3 of them hospitalized, and General Mills recalled Gold Medal all-purpose flour (CDC, 2023).

The habit those outbreaks depend on is common. In a US survey of 1,045 flour users, 66% of those who bake said they ate raw cookie dough or batter, and 85% didn’t know about flour recalls or outbreaks (Feng & Archila-Godínez, 2021).

What to do

Don’t eat or taste raw flour, dough or batter, and that includes cake mix (FDA, 2023; CDC, 2025c). CDC adds a few that people miss: don’t stir raw cookie dough into ice cream or cake mix into a milkshake, and don’t give children raw-flour play dough or flour-and-salt ornaments, because their hands go in their mouths. Wash your hands after handling flour or raw eggs, wash bowls, tools and counters in hot, soapy water, and keep flour and eggs away from food that’s ready to eat (CDC, 2025c). Flour dust travels; the bowl of frosting next to the mixer counts. The same goes for no-cook frostings and fillings: Kansas State bars raw flour and raw eggs in uncooked frostings and fillings (Blakeslee et al., 2020), so cook the flour first, as an ermine frosting does, or use a recipe without it.

Keep store-bought raw dough refrigerated as the label says until you bake it, and throw out or return recalled flour or baking mixes, washing the container you kept them in (CDC, 2023, 2025c). Noting the brand and use-by date of the bag you’re using is what lets you act on a recall; fewer than 11% of the flour users surveyed kept the brand and use-by date, and under 1% kept the lot number (Feng & Archila-Godínez, 2021).

Products sold to be eaten raw are “made with heat-treated flour and pasteurized eggs or no eggs” (CDC, 2025c). In studies, thermal and other treatments of grain and flour cut pathogen counts by 2 to 6 log (that is, a hundredfold to a millionfold), though reviewers still want those treatments validated across products and processes (Rivera et al., 2025).

Contested claim

Heat-treating flour at home. Edible-cookie-dough recipes often tell you to bake flour at 350 °F (177 °C) for a few minutes or to microwave it. In a toaster-oven study, Salmonella in flour about ¾ in (2 cm) deep fell tenfold every 1.7 to 1.9 minutes at 350 °F air temperature, and the authors concluded home baking of flour "has potential" (Jung & Schaffner, 2022). At that rate the widely shared 350 °F for 5 minutes gives at most about a 3-log cut (2.6 to 3.0 log), not the 5-log reduction food safety normally asks for. A 2026 study that followed consumer instructions, with flour ⅕ in (0.5 cm) deep at 350 °F for up to 10 minutes, measured 3.3 log in all-purpose flour and 4.1 in whole-wheat and gluten-free, all short of 5 log, with visible quality damage at the longer times; none of the online methods it tested held up, and the authors say it's unknown whether such treatment is enough for consumers (Nelson et al., 2026). No published study we found validates a microwave method. Home heat treatment lowers the risk; it hasn't been shown to make flour safe to eat raw. Bake the dough, or buy a product made for eating raw.

Raw and lightly cooked eggs

Salmonella Enteritidis can be inside an intact egg, laid down while the egg forms in the hen, and bacteria can also get in through the shell after laying (FSIS, 2024). The rules are short. Buy refrigerated eggs with clean, uncracked shells, and keep them at 40 °F (4 °C) or below, in the carton on a main shelf rather than in the door (FDA, 2024; FSIS, 2024). Don’t leave eggs, cooked eggs or egg dishes out for more than 2 hours, or 1 hour above 90 °F (32 °C) (FDA, 2024; FSIS, 2024). A cold egg left out can sweat, which helps bacteria move inside (FSIS, 2024). Cook egg dishes to 160 °F (71 °C), checked with a thermometer (FDA, 2024).

For anything served raw or undercooked, use pasteurized shell eggs or pasteurized egg products (FDA, 2024; FSIS, 2024). That covers mousse, tiramisù, uncooked egg buttercreams, eggnog, royal icing made with fresh whites and any meringue that won’t be cooked further. It also covers chiffon pies and fruit whips folded with raw beaten whites, which FSIS says “cannot be guaranteed to be safe” (FSIS, 2024). French silk pie needs pasteurized eggs; heating the eggs and sugar to 160 °F lowers the risk but hasn’t been shown to eliminate Salmonella in a sugar-rich filling, and the short bake on a key lime pie isn’t a pasteurization step (Pies, Tarts & Fruit Desserts).

Hot syrup doesn’t reliably pasteurize an Italian meringue or pâte à bombe. Sugar makes Salmonella more heat-resistant, the eggs hit their peak temperature only briefly, and no recipe measures it (Pâtisserie Creams & Meringues). Meringue on a pie is the documented case: an outbreak was traced to a meringue pie made with raw shell eggs that reached only 83 °F (28 °C), and investigators told food-service operators to use pasteurized eggs in any meringue that won’t reach the code temperature of 155 °F (68 °C) (Mazurek et al., 2005). FSIS’s home guidance is that meringue-topped pies “should be safe if baked at 350 degrees F for about 15 minutes” (FSIS, 2024). At meringue sugar levels even 160 °F (71 °C) isn’t a proven kill (Pâtisserie Creams & Meringues), so use pasteurized whites when you’re baking for someone in a higher-risk group.

In the refrigerator, raw shell eggs keep 3 to 5 weeks, separated raw whites and yolks 2 to 4 days and hard-cooked eggs a week; raw whites freeze for a year, but eggs in the shell shouldn’t be frozen (FoodSafety.gov, 2023). Salmonella illness brings diarrhea, fever, cramps and vomiting (FDA, 2024), usually starting 6 hours to 6 days after infection and lasting 4 to 7 days (CDC, 2024).

Cooling, storing and holding

The two numbers

Refrigerate perishable food within 2 hours, or within 1 hour when the room or outdoor air is above 90 °F (32 °C), and keep the refrigerator at 40 °F (4 °C) or below (FSIS, 2020), checked with an appliance thermometer (FDA, 2024). Split large amounts into shallow containers so they cool quickly (FSIS, 2020). FSIS starts the 2 hours at the end of cooking; we count every later spell at room temperature against the same limit, which is the cautious reading. Either way, a custard pie cooling on a rack before it goes in the fridge is already using its time.

The limit applies before baking too. A yeasted dough made with milk, eggs, cream or cheese contains perishable ingredients, so give it a long or overnight rise in the refrigerator rather than on the counter. That’s our reading of the 2-hour rule; no agency writes it for dough. A starter fed with milk, such as an Amish friendship bread starter, is a dairy food: keep it in the refrigerator rather than on the counter for days as many recipes say. Kansas State won’t accept an unrefrigerated one at a fair (Blakeslee et al., 2020).

What needs the refrigerator

The filling decides, not the crust. A bake needs the refrigerator when it carries an egg-and-dairy custard, cream, soft cheese or fresh fruit in a moist filling; it can stay out when it’s dry, sugar-heavy or acidic enough that bacteria can’t grow (Production, Food Safety & Business gives the regulatory version).

Refrigerate, and leave out no more than 2 hours in total: pumpkin and pecan pies, custard and chiffon pies, fresh-fruit pies and quiche (FoodSafety.gov, 2023; Savoie, 2023); other egg-based pies (Savoie, 2023), which include sweet potato, French silk and key lime; cream and meringue pies, cheesecake, cream-filled pastry such as éclairs and cream puffs, and whipped-cream, pastry-cream and mousse fillings, all of which the Food Code treats as needing temperature control (Production, Food Safety & Business); cakes with cream-cheese or whipped-cream frosting (America’s Test Kitchen, n.d.-b; Blakeslee et al., 2020); and egg casseroles and bread puddings, which are egg dishes (FDA, 2024). Cream ganache goes in the fridge unless its water activity is known to be below 0.88 (Chocolate & Confectionery). Refrigeration keeps a chiffon pie from spoiling; it doesn’t make raw whites safe.

Room temperature is fine for breads, most cookies, crackers, biscotti, many muffins and unfilled cakes (Production, Food Safety & Business), and for baked fruit pies made with sugar and no eggs, up to 2 days (Savoie, 2023). Fruit pies made with a sugar substitute go in the fridge, because without the sugar they spoil sooner (Savoie, 2023).

Frostings. Cream-cheese frosting goes in the refrigerator within 2 hours, counting the time it took to make it, and America’s Test Kitchen applies the same limit to whipped-cream and egg frostings (America’s Test Kitchen, n.d.-b). Kansas State University measured a low-fat cream-cheese frosting at water activity 0.91 and pH 5.2, which is in the range where bacteria grow, and by its 65%-sugar rule classes a typical cream-cheese frosting, at 54.8% sugar, as “not stable at room temperature” (Blakeslee et al., 2020).

Contested claim

Butter buttercream on the counter. Kansas State measured a simple buttercream (butter, powdered sugar and a little cream) at water activity 0.83 and pH 4.6, outside the range that needs temperature control, and for Kansas fair exhibits treats a frosting that's at least 65% sugar by weight as stable at room temperature without testing (grams of sugar divided by the recipe's total weight, with corn syrup counted as 70% sugar). It adds that such foods can still spoil over time (Blakeslee et al., 2020). America's Test Kitchen likewise says a simple uncooked buttercream of butter, sugar and flavorings "can sit out for a couple of days" (America's Test Kitchen, n.d.-b). Its reason, that butter is "just 10 percent water," understates it, since US butter only has to be 80% milk fat (Legal Information Institute, n.d.), but the measured water activity is what counts. Some regulators are stricter for frosting sold from a home kitchen: Connecticut accepts as shelf-stable only buttercreams with no butter, eggs, cream or cream cheese, and wants review or lab testing otherwise (Connecticut Department of Consumer Protection, n.d.), and Minnesota allows uncooked dairy frostings only above 65 °Brix and at water activity of 0.85 or below (University of Minnesota Extension, n.d.). Our reading: a buttercream of butter, sugar and flavoring, with at most a splash of cream and at least 65% sugar by weight, can sit out for a day or two. Refrigerate it in hot weather, for longer than that, or when you're baking for someone in a higher-risk group. Frostings with more milk, cream or cream cheese, or less sugar, go in the fridge, and Swiss, Italian and French buttercreams follow the egg rules above.

How long things keep

Item Refrigerator, 40 °F (4 °C) Freezer Source
Pumpkin or pecan pie 3–4 days after baking 1–2 months FoodSafety.gov, 2023; FSIS, 2024
Custard and chiffon pies 3–4 days after baking don’t freeze FoodSafety.gov, 2023
Fresh fruit, custard, cream and chiffon pies up to 4 days don’t freeze well Savoie, 2023
Baked fruit pie, sugar, no eggs 2 days covered at room temperature, then 2 more in the fridge; or up to 7 days in the fridge from the start best within 4 months Savoie, 2023
Fruit pie with a sugar substitute within 2 days best within 2 months Savoie, 2023
Quiche 3–4 days after baking (FoodSafety.gov’s chart says 3–5) 1–2 months (FoodSafety.gov says 2–3) FSIS, 2024; FoodSafety.gov, 2023
Cheesecake 5–7 days 3–6 months FoodKeeper (FoodSafety.gov, n.d.)
Egg casseroles 3–4 days after baking 2–3 months FoodSafety.gov, 2023
Leftover egg dishes and leftovers in general 3–4 days 3–4 months (leftovers in general) FDA, 2024; FSIS, 2020
Bread not recommended; it stales fastest near fridge temperature wrap tightly Aguirre et al., 2011

FoodKeeper’s cheesecake figures are given “for freshness and quality” and are written for a store-bought cheesecake, counted from opening. A homemade cheesecake goes in the fridge too, and the 2-hour limit applies whenever it’s out. No source we consulted gives a number of days for a cake with cream-cheese frosting, so we don’t give one either; keep it refrigerated.

Thawing and reheating

Thaw frozen pies in the refrigerator (Savoie, 2023). For cooked leftovers in general, FSIS lists the refrigerator, cold water and the microwave as safe ways to thaw (FSIS, 2020). The counter isn’t on either list. Reheat leftovers to 165 °F (74 °C), which for a savory pie, quiche or bread pudding means checking the center, not the crust (FSIS, 2020).

Mold

FSIS is clear about baked goods: discard bread and baked goods with mold, because “porous foods can be contaminated below the surface” (FSIS, 2013). Cutting off the spot doesn’t help; what you see is the fruiting part of a growth that runs into the crumb. The same guidance says to throw out moldy jam and jelly (the mold may be making a toxin, and microbiologists advise against scooping it off), moldy soft cheese such as cream cheese, moldy yogurt and sour cream, and moldy nuts and nut butters. Hard cheese is the exception: cut away at least 1 in (2.5 cm) around and below the spot. Don’t sniff a moldy item, which FSIS warns can cause breathing trouble. To slow mold at home it suggests clean dishcloths and sponges, buying small amounts and using them quickly, and keeping household humidity below 40% (FSIS, 2013). Starch retrogradation, the leading explanation for staling (Gray & BeMiller, 2003), runs fastest at refrigerator temperature and more slowly at 0 °F (−18 °C), where existing crystals may grow but few new ones form (Aguirre et al., 2011), so freeze bread you won’t eat soon (Production, Food Safety & Business).

A sourdough starter is a moist food too. If fuzzy mold grows on it, throw it out rather than scraping and feeding it. That’s FSIS’s rule for soft, high-moisture foods applied to a starter; FSIS doesn’t name starters.

Bake sales, potlucks and gifts

Count every minute a perishable item spends at room temperature against the 2-hour limit, which drops to 1 hour above 90 °F (32 °C) outdoors (FSIS, 2020). A custard pie that rides 45 minutes to a picnic and sits on a table for an hour and a half has used up its time. Keep cold food at 40 °F (4 °C) or below, for example by nesting dishes in bowls of ice, and swap in a fresh platter rather than topping up one that’s been sitting out (Minnesota Department of Health, 2022).

For a bake sale, bring what keeps at room temperature: breads, most cookies, muffins, unfilled cakes and baked fruit pies made with sugar and no eggs. Save the custard, cream, cheese and fresh-fruit items, and any buttercream made with milk, cream or cream cheese or under 65% sugar, for events with a refrigerator; a butter-and-sugar buttercream at 65% sugar or more can come on a cool day. Put the ingredients on a card, or at least the major allergens; wheat, milk, eggs, tree nuts, peanuts, soy and sesame are all common in baked goods and are among the nine major US food allergens (Production, Food Safety & Business). Selling from a home kitchen is a different matter, covered by each state’s cottage food law, which in most states allows only shelf-stable items and requires a label; mailing is similar, since without a cold chain only shelf-stable bakes ship safely. Don’t bake or “can” breads and cakes in canning jars for keeping or giving: the National Center for Home Food Preservation recommends against it because of botulism, and if you’re given one, discard it (University of Missouri Extension, 2022).

Other hazards at home

Refrigerate homemade oils made with garlic or herbs and throw them out after 4 days (CDC, 2026). Make garlic oil for focaccia fresh, keep leftovers in the fridge, and never leave it on the counter. For home canning, pressure canning is the only method recommended for low-acid foods (CDC, 2026); this library will cover preserves to the USDA home-canning standard separately and gives no canning method until then. Craft glitter and luster dusts labeled only “non-toxic” aren’t food, and any non-edible decoration comes off before serving (U.S. Food and Drug Administration, 2018); pull florist wire and dowels too. Fresh flowers count as food only when they’re a kind known to be edible and grown without pesticides. Flowers from florists, garden centers and nurseries aren’t grown to be eaten and may have been treated with chemicals that aren’t safe to eat (Newman & Stoven O’Connor, 2025), so they come off as well. Decoration & Finishing sets out which dusts and glitters are edible. And an allergen carried over on a spoon or pan can’t be baked away, so when you bake for someone with a food allergy, wash tools, pans and surfaces first and make their item before anything else (Production, Food Safety & Business).

Doneness and safe internal temperatures

Two different numbers answer “is it done?”: the temperature at which a regulator considers an egg or meat dish safe, and the temperature at which the texture is right. For custards and custard pies the quality figure is the higher one, so baking for texture meets the safety figure. For quiche and sweet bread pudding the two are the same, so pulling early for a softer set can leave you below it. For cheesecake the quality figure is lower. Use an instant-read thermometer in the center or thickest part, away from the pan, and check it now and then in ice water, where it should read 32 °F (0 °C), or in boiling water, which reads 212 °F (100 °C) only at sea level (FSIS, n.d.); Sugar Syrup Physics gives the elevation correction.

Item Safe at Source Done at Source
Quiche, frittata 160 °F (71 °C) FoodSafety.gov, 2024 about 160 °F (71 °C) ThermoWorks, n.d.
Strata, savory bread pudding, other egg casseroles 165 °F (74 °C) FoodSafety.gov, 2024
Sweet bread pudding 160 °F (71 °C) FDA, 2024 about 160 °F (71 °C) ThermoWorks, n.d.
Baked custard, flan, pumpkin and custard pies 160 °F (71 °C) FDA, 2024 170–175 °F (77–79 °C) ThermoWorks, n.d.
Cheesecake 160 °F (71 °C) FDA, 2024 about 145–150 °F (63–66 °C), center still wobbling America’s Test Kitchen, n.d.-a; ThermoWorks, n.d.
Meringue on a pie, shell eggs “should be safe” baked at 350 °F (177 °C) for about 15 minutes; not shown to pasteurize at meringue sugar levels, so pasteurized whites for higher-risk eaters FSIS, 2024 about 160 °F (71 °C) ThermoWorks, n.d.
Lean bread about 190–210 °F (88–99 °C) ThermoWorks, n.d.
Enriched and sandwich bread about 180–190 °F (82–88 °C) ThermoWorks, n.d.
Cakes about 200–210 °F (93–99 °C) ThermoWorks, n.d.
Molten (lava) cake 160 °F (71 °C) FDA, 2024 160 °F (71 °C) ThermoWorks, n.d.
Baking with poultry, including ground poultry and chicken or turkey sausage 165 °F (74 °C) FoodSafety.gov, 2024
Baking with ground beef, pork or lamb, or sausage made from them 160 °F (71 °C) FoodSafety.gov, 2024
Reheated leftovers 165 °F (74 °C) FSIS, 2020

King Arthur Baking (2017) bakes sandwich loaves and soft rolls to about 190 °F (88 °C); America’s Test Kitchen puts lean loaves at 205–210 °F (96–99 °C) and enriched ones at 190–195 °F (88–91 °C), so the bread sources differ at the low end (Tools & Equipment).

Contested claim

Cheesecake below 160 °F. The usual pull point, about 145–150 °F (63–66 °C) at the center (America's Test Kitchen, n.d.-a; ThermoWorks, n.d.), is below the 160 °F FDA gives for egg dishes. For eggs in food businesses, the Food Code accepts 150 °F (66 °C) held for 1 minute, or 145 °F (63 °C) for 3 minutes, as equal to 155 °F for 17 seconds (FDA, 2026), but no source we found has measured whether a home cheesecake's center stays that hot that long. It's unmeasured, which isn't the same as shown safe. When you're baking for children, older adults, pregnant women or anyone with a weakened immune system, use pasteurized eggs, or bake low and slow to 160–165 °F (71–74 °C) at the center, as [Cakes & Sponges](/atlases/cakes/) describes.

References