Dinners

How to Bake Macaroni and Cheese in the Oven

Updated · By Stir & Share

USDA safe temp
160°F / 71°C
check the thickest part

Save

Baked macaroni and cheese is a creamy pasta casserole with a golden, crispy topping, perfect for a weeknight dinner or a holiday side dish. The classic method cooks the pasta, makes a stovetop cheese sauce, combines them, and bakes until bubbly and browned. The method differs if you want a crustless, extra-creamy version or a make-ahead casserole.

Baked Mac and Cheese Needs a Stovetop Sauce First

Baking alone will not create a smooth cheese sauce; you need to make a roux-based sauce on the stove before baking. This prevents the cheese from turning grainy and keeps the pasta creamy. The oven then finishes the dish by melting the top cheese and setting the sauce.

Before You Start: What to Have Ready

  • 9×13-inch (23×33 cm) baking dish, greased
  • Large pot for pasta and a separate saucepan for sauce
  • Whisk, wooden spoon, measuring cups and spoons
  • Food thermometer (for checking the casserole reaches 160°F / 71°C)
  • Shredded cheese (shredding your own melts smoother than pre-shredded)

Steps: From Pot to Oven

  1. Preheat the oven to 375°F (190°C). Grease a 9×13-inch (23×33 cm) baking dish.
  2. Bring a large pot of salted water to a boil. Cook 1 lb (450 g) elbow macaroni for 2 minutes less than the package directs; it will finish cooking in the oven. Drain and set aside.
  3. In a large saucepan over medium heat, melt 6 tbsp (85 g) butter. Add 1/3 cup (40 g) all-purpose flour and whisk constantly for 1–2 minutes, until the mixture turns light golden and smells nutty.
  4. Slowly pour in 4 cups (960 ml) whole milk, whisking constantly to prevent lumps. Cook over medium heat, stirring, until the sauce thickens enough to coat the back of a spoon, about 5–7 minutes.
  5. Remove the pan from heat. Stir in 3 cups (340 g) shredded sharp cheddar cheese and 1 cup (100 g) shredded Gruyère or Monterey Jack, a handful at a time, until fully melted and smooth. Season with 1 tsp salt, 1/2 tsp black pepper, and 1/2 tsp dry mustard (optional).
  6. Add the drained macaroni to the sauce and stir until every piece is coated. Pour the mixture into the prepared dish and spread evenly.
  7. Top with 1 cup (110 g) shredded cheddar and, if you like, 1/2 cup (50 g) panko breadcrumbs mixed with 2 tbsp (30 g) melted butter.
  8. Bake uncovered for 20–25 minutes, until the top is golden and the sauce is bubbling at the edges. The casserole is done when a food thermometer inserted into the center reads 160°F (71°C), the USDA FSIS safe minimum for egg dishes and casseroles.
  9. Let rest for 5–10 minutes before serving; this lets the sauce set so it does not run.

When It Goes Wrong: Curdled Sauce, Dry Bake, or Runny Center

Symptom Cause Fix
Grainy, separated sauce High heat, pre-shredded cheese with anti-caking agents, or adding cheese too fast Use block cheese you shred yourself; keep heat low; add cheese off heat in small handfuls.
Dry, tough mac and cheese Overbaking or too little sauce Check at 20 minutes; bake only until bubbly and golden. Ensure sauce is thin enough to coat pasta before baking.
Runny center after baking Not enough roux or pasta undercooked Cook the roux until it thickens; use 1/3 cup flour per 4 cups milk. Undercook pasta by 2 minutes.
Top burns before center heats Oven too hot or dish too shallow Bake at 375°F (190°C); if top browns early, cover loosely with foil for the rest of the bake.

How to Tell It Worked: Golden Top, Set Sauce, Creamy Inside

The top should be browned in spots, and the sauce should bubble around the edges. A knife inserted near the center should come out hot and coated with creamy sauce, not watery. The pasta should be tender but not mushy. Resting for 5–10 minutes lets the sauce thicken to a spoonable consistency.

Make-Ahead and Storage: Reheats Without Drying Out

Assemble the casserole completely, cover, and refrigerate for up to 24 hours before baking. Add 10–15 minutes to the bake time, and start checking at 30 minutes. Leftovers keep refrigerated for 3–4 days. Reheat individual portions in the microwave or oven; add a splash of milk to restore creaminess. The baked casserole freezes well for up to 2 months; thaw overnight in the fridge before reheating at 350°F (177°C) until hot throughout.

Swaps That Work: Different Cheeses and Add-Ins

Sharp cheddar is the classic base; substitute half with Gouda, smoked cheddar, or Colby for a different flavor. Gruyère adds nuttiness but can be replaced with Swiss or extra cheddar. For a spicier version, add 1/2 tsp cayenne or a diced jalapeño to the sauce. Add cooked bacon, sautéed mushrooms, or roasted broccoli just before baking; these add moisture, so reduce the milk by 1/4 cup (60 ml) to keep the sauce thick.

Can You Use Pre-Shredded Cheese?

Yes, but it may make the sauce slightly grainy because of the anti-caking coating. For the smoothest sauce, shred from a block. If using pre-shredded, add it slowly and stir until fully melted before adding more.

What If the Sauce Is Too Thick or Too Thin?

If the sauce is too thick before baking, whisk in extra milk 1/4 cup (60 ml) at a time. If it is too thin, cook it a few minutes longer on the stove; it should coat the back of a spoon. The sauce will thicken further in the oven as the pasta absorbs liquid.

Related

Safe minimum internal temperatures follow USDA FSIS; raw-fish guidance follows the U.S. FDA. See our food safety notes.

Spotted an error? Tell us and we will correct it (corrections policy).