Ultimate Baked Mac and Cheese with Bacon & Caramelized Onion

Tested in my kitchen: This recipe was tested in a home kitchen for easy timing, texture, and repeatable results.
Reading time 12 min
Baked mac and cheese with bacon and caramelized onions in a rustic terracotta baking dish

The Cozy Bake That Saved My Thanksgiving Table

Have you ever been put in charge of a holiday side dish and immediately panicked? That was me three Thanksgivings ago, standing in my mom’s kitchen with a borrowed casserole dish and absolutely no plan. I rummaged through the fridge, found a wedge of gruyere, a few strips of bacon, and a bag of onions, and somehow ended up creating this baked mac and cheese with bacon and caramelized onions. It’s been the most-requested side at every family gathering since.

The trick — and the thing that makes this recipe different from a hundred other mac and cheese recipes on the internet — is the caramelized onion. Most mac and cheese is just creamy and rich, which is wonderful, but adding those slow-cooked, jammy golden onions gives the dish a savory sweetness that makes people close their eyes on the first bite. Combined with smoky bacon and a trio of melty cheeses, this is the kind of bake that turns a regular Tuesday into something worth gathering around the table for.

Baked Mac and Cheese with Bacon and Caramelized Onion

What I love most about this version is how forgiving it is. The caramelized onions can be made up to three days ahead and stored in the fridge. The bacon can be swapped for pancetta or even leftover holiday ham. The cheese blend can be tweaked to whatever you’ve got on hand — gruyere for nuttiness, sharp white cheddar for tang, and a little orange cheddar for color. The shellbows (or any small pasta with nooks and crannies) hold onto the sauce beautifully, and the breadcrumb topping adds the kind of crunch that keeps everyone reaching for seconds.

Make it once for a Sunday supper and you’ll see what I mean — this is comfort food with a little extra love baked right in. Have you ever tried a savory-sweet mac and cheese before? If not, you’re in for a real treat.

Flat-lay of shellbows pasta, three cheeses, bacon, onions, thyme, milk, cream, panko, and brown sugar

My Step-by-Step Method

Step 1: Caramelize the onions first. This is the longest step, so get them going right at the start. Heat 2 tablespoons of butter and 1 tablespoon of olive oil in a heavy-bottomed skillet over medium-low heat. Add thinly sliced yellow onions (about 2 large onions), a pinch of salt, and a teaspoon of brown sugar. Cook slowly, stirring every few minutes, for 35 to 40 minutes until the onions are deeply golden, jammy, and meltingly soft. Don’t rush this — low and slow is the secret. When they’re done, deglaze the pan with a small splash of balsamic vinegar, stir to combine, and set aside. The kitchen is going to smell incredible.

Step 2: Cook the bacon until crispy. In a separate skillet over medium heat, fry 8 strips of bacon until deeply golden and crisp, about 5 to 6 minutes per side. Transfer to a paper-towel-lined plate to drain, then chop into small bits. Reserve about a tablespoon of the bacon fat in the pan — you’ll use it to build the cheese sauce for extra flavor.

Step 3: Boil the pasta just under al dente. Bring a large pot of generously salted water to a boil. Add 1 pound of shellbows (or cavatappi, or classic elbow) and cook for 6 minutes — about 2 minutes less than the package says. The pasta will finish cooking in the oven, so you want it firm enough to hold its shape. Drain well, toss with a small pat of butter to keep it from sticking, and set aside.

Step 4: Build the cheese sauce. In a large saucepan over medium heat, melt 4 tablespoons of butter (or use the reserved bacon fat for extra flavor). Sprinkle in 1/4 cup of all-purpose flour and whisk constantly for 1 minute to cook off the raw flour taste. Slowly pour in 3 3/4 cups of whole milk, whisking the whole time to keep the sauce smooth. Add 1 teaspoon of ground mustard, a pinch of cayenne, 1 teaspoon of salt, 1/2 teaspoon of black pepper, and 1/4 teaspoon of grated nutmeg. Cook, whisking often, for 5 to 7 minutes until the sauce thickens enough to coat the back of a spoon. Remove from the heat and whisk in 3 cups of grated sharp white cheddar, 1 cup of grated gruyere, and 1/2 cup of grated orange cheddar (for color, if you like that golden hue). Stir in 1/3 cup of heavy cream at the end for extra silkiness.

Step 5: Combine and assemble. Add the cooked pasta to the cheese sauce along with half of the crispy bacon bits and half of the caramelized onions. Stir gently to coat every shell. Pour into a buttered 3-quart baking dish and spread into an even layer. Top with the remaining bacon and onions, then sprinkle 1/2 cup of panko breadcrumbs tossed with 1 tablespoon of melted butter evenly over the top.

Step 6: Bake until bubbling and golden. Bake in a 375°F oven for 20 to 25 minutes, until the top is deeply golden, the cheese is bubbling around the edges, and the breadcrumb topping is crisp. Let it rest for 5 minutes before serving — this is the hardest part, I know, but it lets the sauce thicken back up so every scoop holds its shape. Then dig in and watch it disappear.

Hand sprinkling crumbled bacon over baked mac and cheese with caramelized onions in a terracotta dish

Creative Twists to Make It Your Own

Once you’ve made this version a few times, you’ll start seeing all the ways you can play with it. Here are a few of my favorite riffs for different occasions:

  • Add a French onion vibe. Stir a splash of dry white wine into the cheese sauce and top with gruyere only for an extra-browned, soup-inspired version.
  • Go smoky. Swap regular bacon for applewood-smoked bacon, or add 1/2 teaspoon of smoked paprika to the cheese sauce for a deeper smoky note.
  • Make it spicy. Stir a diced chipotle pepper in adobo into the cheese sauce, or top with sliced pickled jalapeños before baking for a kick.
  • Try different pasta shapes. Cavatappi, cellentani, or even large elbow macaroni all work. The nooks and curves catch the cheese sauce beautifully.
  • Add veggies. Stir in a handful of baby spinach at the very end, or top with roasted broccoli florets before baking for a more substantial one-dish meal.
  • Make it brunch-worthy. Crack 4 eggs into indentations in the top of the unbaked mac and cheese, then bake as directed for a shakshuka-style twist.
  • Gluten-free option. Substitute a 1:1 gluten-free flour blend for the roux, and use gluten-free panko or crushed rice cereal for the topping.

Serving & Pairing Ideas

What should I serve alongside this baked mac and cheese? This dish plays well with just about anything. For a holiday table, I’d pair it with roast turkey or ham, a crisp green salad with a sharp vinaigrette (the acidity balances all that richness), and some roasted Brussels sprouts or green beans. For a weeknight dinner, a simple arugula salad and a glass of chilled Chardonnay is all you need. And if you’re bringing it to a potluck, just transport it in the baking dish, reheat covered with foil at 350°F for 15 minutes, and finish under the broiler for a minute to re-crisp the topping. What’s your favorite thing to serve alongside mac and cheese?

Brass spoon lifting a portion of baked mac and cheese with cheese stretch from a terracotta dish

Why I Love This Recipe

There are a few reasons this baked mac and cheese lives at the top of my comfort food list. First, the caramelized onions add a layer of flavor you just don’t get in most mac recipes — that slow-cooked sweetness is the difference between a good side and a memorable one. Second, the trio of cheeses (gruyere, white cheddar, and a touch of orange cheddar for color) melts into the silkiest, dreamiest sauce without ever getting grainy. And third, it’s the rare holiday side dish that actually holds up well as leftovers — the pasta absorbs the sauce overnight, so day-two baked mac and cheese is arguably even better than the original.

I also love that this recipe is incredibly make-ahead friendly. Caramelize the onions up to 3 days in advance. Cook the bacon a day ahead. Assemble the entire dish the morning of, refrigerate, and bake when you’re ready. The only thing you have to do the day-of is pop it in the oven, which means you can spend more time with your guests and less time in the kitchen. Which is the whole point of a holiday side dish, isn’t it?

Storage and Make-Ahead Tips

Make ahead: Assemble the entire dish up to the point of adding the breadcrumb topping, cover tightly with plastic wrap, and refrigerate for up to 24 hours. When ready to bake, let it sit at room temperature for 20 minutes, top with the buttered breadcrumbs, and bake as directed (add 5-10 minutes to the bake time if starting from cold).

Refrigerator: Leftover baked mac and cheese keeps in an airtight container in the fridge for up to 4 days. Reheat individual portions in the microwave with a splash of milk, or reheat a larger portion covered with foil in a 350°F oven for 15-20 minutes.

Freezer (unbaked): Assemble the dish in a freezer-safe baking pan, cover tightly with foil, and freeze for up to 2 months. Thaw overnight in the fridge before baking. Add the breadcrumb topping just before baking, not before freezing (the crumbs can get soggy).

Freezer (baked): Cool completely, then cover tightly and freeze for up to 2 months. Thaw overnight in the fridge and reheat covered with foil at 350°F for 25-30 minutes. Refresh the topping under the broiler for the last 2 minutes if needed.

Caramelized onions: These are the ultimate meal-prep ingredient. Make a big batch and freeze in 1/2-cup portions for up to 3 months. They’re wonderful on burgers, pizzas, flatbreads, or stirred into grain bowls.

Single serving of baked mac and cheese with caramelized onions in a cream stoneware bowl

Troubleshooting Your Bake

My cheese sauce is grainy or clumpy. The heat was too high, or you added the cheese too quickly. Remove the sauce from the heat entirely, let it cool for 2 minutes, then add the cheese in small handfuls, whisking gently until each addition melts before adding the next. Pre-shredded cheese often contains anti-caking agents that make sauces grainy — always buy blocks and grate them yourself for the smoothest results.

The pasta is mushy after baking. You probably cooked it to full al dente before baking. Pull the pasta out 2 minutes earlier next time — it should be quite firm when you drain it. It will finish cooking and absorb the sauce in the oven, ending up perfectly tender by serving time.

The top is browning too fast. Tent the dish loosely with aluminum foil for the first 15 minutes of baking, then remove the foil for the last 10 minutes to let the breadcrumb topping get golden and crisp. This trick works for any casserole-style bake.

The sauce looks thin before baking. It will thicken considerably in the oven as the pasta absorbs it. If the sauce seems too thick before baking, stir in an extra splash of milk. If it seems too thin, your pasta was probably a bit undercooked and will soak up the excess — just be sure to bake the full time.

The onions taste bitter instead of sweet. You probably cooked them too fast over too-high heat, or didn’t stir them often enough. Caramelizing onions is a 35-40 minute low and slow process — rushing it caramelizes the sugars too quickly and leaves a burnt, bitter flavor. Keep the heat at medium-low and stir every few minutes.

Your Quick Questions, Answered

Can I use pre-shredded cheese? You can, but the sauce won’t be as silky. Pre-shredded cheese is coated with anti-caking agents like potato starch or cellulose, which can make the sauce grainy. For the best results, buy blocks of cheese and grate them yourself — it only takes a couple of minutes and makes a huge difference in texture.

Can I make this vegetarian? Absolutely. Just skip the bacon and use butter instead of bacon fat in the cheese sauce. To keep that smoky depth, add 1/2 teaspoon of smoked paprika to the cheese sauce, or sprinkle some smoked salt on top before serving.

What pasta shape works best? Shellbows (medium shells) are my favorite for this recipe because the cup shape catches the cheese sauce and the caramelized onions. Cavatappi, cellentani, and classic elbow macaroni all work well too. Avoid long pasta like spaghetti or fettuccine — they don’t hold the sauce as well in a baked dish.

Can I use pancetta instead of bacon? Yes — pancetta works beautifully and has a slightly more delicate, less smoky flavor. Prosciutto also works, but it’s saltier so I’d reduce the added salt in the cheese sauce by half.

How do I reheat leftovers without drying them out? The microwave is fine for individual portions — just add a splash of milk before reheating to loosen the sauce. For larger portions, cover with foil and reheat in a 350°F oven for 15-20 minutes. The breadcrumb topping won’t be quite as crisp, but the flavor will still be wonderful.

A Few Last Thoughts

This baked mac and cheese with bacon and caramelized onions is the kind of recipe that makes people remember a meal. It’s rich and comforting, with that slow-cooked sweetness from the onions, the smoky saltiness from the bacon, and the creamy tang of the three-cheese sauce all working together in perfect harmony. I make it for holidays, for Sunday dinners, and honestly sometimes just for a random Wednesday when I need a win.

If you try this recipe, I’d love to hear how it turned out for you. Did you add a smoky element, swap the pasta shape, or sneak in a vegetable? Drop me a comment below — I read every single one, and your twists often become my next favorite version. Until next time, happy cooking, friends.

—Elowen Thorn

Ultimate Baked Mac and Cheese with Bacon & Caramelized Onion

Difficulty:BeginnerPrep time: 30 minutesCook time: 40 minutesRest time: 40 minutesTotal time:1 hour 50 minutesCooking Temp:100 CServings:4 servingsEstimated Cost:25 $Calories:300 kcal Best Season:Summer
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x