Gruyere Mac and Cheese with Caramelized Onions is a rich, comforting baked pasta dish that balances creamy cheese sauce with the deep sweetness of slowly cooked onions. The nutty flavor of Gruyere melts beautifully into the sauce, creating a smooth and savory base that coats every piece of pasta.
This recipe turns a familiar favorite into something a little more special without making it complicated. A simple roux, warm milk, tender pasta, and a crisp golden topping come together for a casserole-style mac and cheese that feels equally fitting for a cozy family dinner or a holiday side dish.
The caramelized onions add real depth and a gentle sweetness that pairs especially well with the browned cheese and buttery breadcrumbs on top. Serve it hot from the oven while the center is creamy and the top is lightly crisp for the best texture and flavor.
Recipe Overview
- Prep time: 20 minutes
- Cook time: 55 minutes
- Total time: 75 minutes
- Servings: 6 servings
- Difficulty: Medium
Why You’ll Love It
- The Gruyere creates a smooth, nutty cheese sauce with excellent melt and flavor.
- Caramelized onions add sweetness and depth that make the dish taste more complex than standard mac and cheese.
- The crisp breadcrumb topping contrasts nicely with the creamy pasta underneath.
- It works well as a main dish or as a hearty side for gatherings and holiday meals.
- The ingredients are familiar and straightforward, but the final result feels special and comforting.
Nutritional Benefits and Adaptable Variations
- Use sharp white cheddar for part of the Gruyere if you want a slightly tangier cheese flavor while keeping the sauce creamy.
- Add 1 gram of ground black pepper or a pinch of cayenne to the sauce for a little extra warmth.
- Swap panko for fresh breadcrumbs if you prefer a softer topping with gentle crunch.
- Stir in 150 grams of baby spinach at the end of the sauce step for a simple vegetable addition.
- Bake the dish in individual ramekins for a dinner-party presentation and slightly more crisp topping per serving.
Ingredients
- 300 grams elbow macaroni
- 30 milliliters olive oil
- 450 grams yellow onions, thinly sliced
- 6 grams kosher salt, divided
- 42 grams unsalted butter
- 30 grams all-purpose flour
- 600 milliliters whole milk, warmed
- 1 gram Dijon mustard
- 1 gram garlic powder
- 1 gram black pepper
- 240 grams Gruyere cheese, shredded
- 50 grams Parmesan cheese, finely grated
- 60 grams panko breadcrumbs
- 15 grams chopped fresh parsley
Step-by-Step Instructions

- Bring a large pot of well-salted water to a boil. Add the elbow macaroni and cook until just shy of al dente according to the package directions, usually about 1 to 2 minutes less than fully cooked. Drain well and set aside.
- While the pasta cooks, heat the olive oil in a large skillet over medium heat. Add the sliced onions and 3 grams of the kosher salt. Cook, stirring often, for 25 to 30 minutes until the onions are deeply golden, soft, and caramelized. Lower the heat if they begin to brown too quickly. Transfer the onions to a bowl.
- Preheat the oven to 190 degrees Celsius. Lightly butter or oil a 2-liter baking dish.
- In a large saucepan, melt the butter over medium heat. Sprinkle in the flour and whisk constantly for about 1 minute until a smooth paste forms and the raw flour smell fades.
- Slowly pour in the warmed milk while whisking continuously to prevent lumps. Cook for 3 to 5 minutes, whisking often, until the sauce thickens enough to coat the back of a spoon.
- Whisk in the remaining 3 grams kosher salt, Dijon mustard, garlic powder, and black pepper. Reduce the heat to low, then add the Gruyere and 35 grams of the Parmesan a handful at a time, stirring until fully melted and smooth.
- Fold the cooked macaroni and the caramelized onions into the cheese sauce. Stir until the pasta is evenly coated, then transfer the mixture to the prepared baking dish and spread it into an even layer.
- In a small bowl, combine the panko breadcrumbs, remaining 15 grams Parmesan, and chopped parsley. Sprinkle the mixture evenly over the mac and cheese.
- Bake for 18 to 20 minutes until bubbling around the edges and golden on top. Let the dish rest for 5 minutes before serving so the sauce can settle slightly.
Tips, Serving Suggestions & Substitutions
- Warm the milk before adding it to the roux so the sauce thickens more smoothly.
- Cook the onions patiently over moderate heat to develop sweetness without burning them.
- Shred the Gruyere yourself for the best melt and texture in the sauce.
- Do not overcook the pasta before baking or it may become too soft in the oven.
- Let the baked mac and cheese rest briefly before serving so it holds together better on the plate.
Nutrition Information
| Per Serving | Approximate Amount |
|---|---|
| Calories | 564 kcal |
| Carbohydrates | 42 g |
| Protein | 24 g |
| Fat | 33 g |
| Saturated Fat | 17 g |
| Cholesterol | 82 mg |
| Sodium | 612 mg |
| Fiber | 3 g |
| Sugar | 8 g |
Nutrition is an approximate estimate per serving based on 6 servings and can vary with the exact brands of pasta, cheese, and breadcrumbs used.
Storage & Make-Ahead Tips
Refrigerate leftovers in an airtight container for up to 3 days.
Reheat covered in a 180 degrees Celsius oven or in the microwave with a small splash of milk to loosen the sauce.
For best texture, store the baked dish after it has cooled completely and reheat only the portion you plan to serve.
FAQ
1. Can I make this recipe ahead of time?
Yes. You can assemble the mac and cheese, cover it, and refrigerate it before baking. When ready to cook, let it sit at room temperature for about 20 minutes, then bake until hot and bubbly, adding a few extra minutes if needed.
2. What can I use instead of Gruyere?
A combination of Swiss cheese and sharp white cheddar works well if Gruyere is unavailable. The flavor will be a little different, but the dish will still be creamy and flavorful.
3. Why are my onions not caramelizing properly?
Caramelized onions need steady heat and time. If the pan is too hot, they can burn before softening. If the pan is crowded or the heat is too low, they may steam instead of turning golden. Stir often and be patient.
4. Can I skip the breadcrumb topping?
Yes. The topping adds texture, but the mac and cheese will still be delicious without it. You can also replace it with a light extra sprinkle of cheese if preferred.
5. How do I keep the cheese sauce smooth?
Use warmed milk, whisk well while building the sauce, and melt the cheese over low heat. Adding the cheese gradually helps it blend evenly without becoming grainy.
Final Thoughts
This mac and cheese is a great choice when you want something deeply comforting with a little extra flavor from the caramelized onions and Gruyere. The balance of creamy sauce, tender pasta, and crisp topping makes it satisfying from the first bite to the last.
Serve it alongside a simple green salad or roasted vegetables for a complete meal, or bring it to the table as a crowd-pleasing side. It is a warm, savory dish that feels classic while still offering a richer, more layered flavor.

Gruyere Mac and Cheese with Caramelized Onions
Ingredients
- 300 grams elbow macaroni
- 30 milliliters olive oil
- 450 grams yellow onions thinly sliced
- 6 grams kosher salt divided
- 42 grams unsalted butter
- 30 grams all-purpose flour
- 600 milliliters whole milk warmed
- 1 gram Dijon mustard
- 1 gram garlic powder
- 1 gram black pepper
- 240 grams Gruyere cheese shredded
- 50 grams Parmesan cheese finely grated
- 60 grams panko breadcrumbs
- 15 grams chopped fresh parsley
Instructions
- Bring a large pot of well-salted water to a boil. Add the elbow macaroni and cook until just shy of al dente according to the package directions, usually about 1 to 2 minutes less than fully cooked. Drain well and set aside.
- While the pasta cooks, heat the olive oil in a large skillet over medium heat. Add the sliced onions and 3 grams of the kosher salt. Cook, stirring often, for 25 to 30 minutes until the onions are deeply golden, soft, and caramelized. Lower the heat if they begin to brown too quickly. Transfer the onions to a bowl.
- Preheat the oven to 190 degrees Celsius. Lightly butter or oil a 2-liter baking dish.
- In a large saucepan, melt the butter over medium heat. Sprinkle in the flour and whisk constantly for about 1 minute until a smooth paste forms and the raw flour smell fades.
- Slowly pour in the warmed milk while whisking continuously to prevent lumps. Cook for 3 to 5 minutes, whisking often, until the sauce thickens enough to coat the back of a spoon.
- Whisk in the remaining 3 grams kosher salt, Dijon mustard, garlic powder, and black pepper. Reduce the heat to low, then add the Gruyere and 35 grams of the Parmesan a handful at a time, stirring until fully melted and smooth.
- Fold the cooked macaroni and the caramelized onions into the cheese sauce. Stir until the pasta is evenly coated, then transfer the mixture to the prepared baking dish and spread it into an even layer.
- In a small bowl, combine the panko breadcrumbs, remaining 15 grams Parmesan, and chopped parsley. Sprinkle the mixture evenly over the mac and cheese.
- Bake for 18 to 20 minutes until bubbling around the edges and golden on top. Let the dish rest for 5 minutes before serving so the sauce can settle slightly.
