Summary: Baked cod au gratin with aioli combines desalted cod loins with a layer of homemade aioli that is gratinated until golden brown, creating a spectacular contrast between the creamy texture of the aioli, the crunchy gratin crust, and the juiciness of the cod. It’s prepared in 35 minutes: 15 for prep and 20 for baking. It’s an elegant, simple dish with a pure Mediterranean flavor.
Why are aioli and cod the perfect pair?
Aioli (all i oli in Catalan — "garlic and oil") is one of the oldest sauces in the Mediterranean. Its combination with cod is natural: the richness of the aioli complements the firm and slightly dry texture of baked cod, while the garlic enhances the fish's flavor without overpowering it.
This combination has deep roots in Catalan and Levantine cuisine. In Barcelona, cod au gratin with aioli is a Lenten classic that has become a year-round dish. In Valencia, aioli accompanies cod in multiple preparations. And throughout the Mediterranean coast, garlic and cod are inseparable.
The gratin adds another dimension: the layer of aioli toasts under the grill, creating a golden crust that is pure texture. Breaking it with a fork reveals the creamy aioli underneath, and further down, the juicy and tender cod. Three textures in one bite.
The best thing about this dish is its balance between elegance and ease. It looks like a restaurant dish but is prepared in 35 minutes with basic ingredients. It's perfect for a dinner party when you want to impress without spending hours in the kitchen.
The perfect homemade aioli for gratinating
Aioli for gratinating should be slightly thicker than regular accompanying aioli. It needs to withstand oven temperatures without completely melting. There are two options:
Option A — Traditional aioli (garlic and oil only):
- Peel 4-5 cloves of garlic and crush them in a mortar with a pinch of salt until a paste is formed.
- Add extra virgin olive oil drop by drop while turning the pestle in the same direction.
- Continue adding oil (about 200 ml in total) very slowly until a thick emulsion is obtained.
- This aioli is the most authentic but also the most difficult. If it separates, add a few drops of cold water and continue stirring.
Option B — Aioli with egg (easier and more stable):
- Place in a blender cup: 1 whole egg, 4 peeled garlic cloves, a pinch of salt, and a splash of lemon juice.
- Add 250 ml of mild olive oil (or a mix of sunflower + olive).
- Insert the hand blender to the bottom without moving it. Turn it on at maximum power. When you see it start to emulsify at the bottom, slowly lift the blender.
- In 30 seconds, you'll have a thick and stable aioli, perfect for gratinating.
For gratinating, Option B is more practical: it emulsifies better, is more heat-stable, and the final result is practically indistinguishable once gratinated.
Ingredients for 4 people
| Ingredient | Quantity |
|---|---|
| Desalted cod loins | 4 pieces (~700 g) |
| Homemade aioli | 200 g (approx.) |
| Potatoes | 3 medium (optional) |
| Extra virgin olive oil | 3 tablespoons |
| Salt and pepper | To taste |
| Fresh parsley | For garnish |
Premium desalted cod for gratinating
Thick and juicy loins, perfect for the oven. Selected directly from the producer.
View desalted cod collectionStep-by-step recipe
Step 1 — Preheat the oven. Turn on the oven to 200 °C (400°F) with heat from top and bottom. If you are using potatoes as a base, this is the time to prepare them.
Step 2 — Prepare the base (optional). Peel and thinly slice the potatoes (3-4 mm). Place them in a lightly greased baking dish, forming an even layer. Season with salt, pepper, and a drizzle of olive oil. Bake for 10 minutes to start cooking them before adding the cod.
Step 3 — Prepare the cod. Pat the desalted cod loins dry with paper towels. This step is important: moisture prevents even browning. Season lightly with pepper (do not add salt if the cod still has some saltiness from desalting).
Step 4 — Assemble the dish. Place the cod loins on the bed of potatoes (or directly in the dish if not using potatoes). Cover each loin with a generous layer of aioli — about 2-3 cm thick. The aioli should cover the entire surface of the cod like a blanket.
Step 5 — Bake. Place the dish in the oven at 200 °C (400°F) for 15 minutes. The cod will cook from below while the aioli heats from above.
Step 6 — Gratinate. Activate only the grill (top heat) at maximum power for 3-5 minutes. Watch constantly: the aioli should brown evenly, with bubbles and toasted spots, but without burning. The difference between perfectly golden and burnt is literally 30 seconds.
Step 7 — Serve. Remove from the oven, let rest for 2 minutes, and garnish with fresh chopped parsley. Serve directly from the dish.
6 tips for a perfect gratin
- Thick aioli: a liquid aioli will run off the sides of the cod. You need a dense mayonnaise-like consistency to keep it in place.
- Thick layer: don't put a thin layer of aioli. You need 2-3 cm to create that double texture: crust on the outside, creamy on the inside.
- Dry cod exterior: pat the loins dry with paper towels. Moisture creates steam that prevents even browning of the aioli.
- Monitored grill: never leave the oven with the grill on. The aioli goes from perfectly golden to burnt in seconds.
- Not too large a dish: if the dish is too wide, the heat will disperse. Use a dish that fits the size of the loins.
- Potatoes as insulation: the bed of potatoes acts as thermal insulation, preventing the base of the cod from drying out. If you don't use potatoes, drizzle a little oil in the bottom of the dish.
If you want to explore more ways to gratinate cod, check out our article on cod au gratin: complete guide. And to master cod oven cooking times, read our definitive guide to oven-baked cod.
Cod gratin variations
- With tomato: a bed of homemade crushed tomatoes under the cod, aioli on top. The acidic-creamy contrast is magnificent.
- With roasted vegetables: onion, red pepper, and zucchini as a base instead of potatoes. Lighter and more colorful.
- With black aioli: aioli made with fermented black garlic. Sweet and umami flavor that surprises. The dark color of the aioli visually contrasts with the white cod.
- With pesto and aioli: mix half aioli and half Genoese pesto. Enhanced Mediterranean flavor.
- Individual in ramekins: flake the cod, mix it with cooked potato, cover with aioli, and gratinate in individual ramekins. Restaurant-style presentation.
Recommended side dishes
- Green salad: the freshness and acidity of a vinaigrette salad contrasts with the richness of gratinated aioli.
- Piquillo peppers: roasted or canned, their sweetness complements the garlic in the aioli.
- Crusty bread: for dipping in the leftover aioli from the dish. Essential.
- Grilled green asparagus: their mild bitterness balances the richness of the dish.
- Wine: a full-bodied white like a Godello, a barrel-fermented Verdejo, or a brut nature cava. The wine's acidity cuts through the fat of the aioli.
Nutritional values per serving
| Nutrient | Per serving (with potatoes) |
|---|---|
| Calories | ~520 kcal |
| Protein | 35 g |
| Fat | 36 g |
| Carbohydrates | 18 g |
A hearty but nutritionally interesting dish: high in protein from the cod, healthy fats from olive oil, and garlic with antibacterial properties. Without the potatoes, calories drop to about 400 kcal and carbohydrates practically disappear.
🛒 Products used in this recipe
⭐ 4.9/5 · Cold shipping 24-48h · Since 1990 at Mercat del Ninot
Conclusion
Cod au gratin with aioli is one of those dishes that proves Mediterranean cuisine shines when it's simple. You don't need complicated techniques or exotic ingredients: quality cod, good homemade aioli, and a working oven. The result is spectacular: a golden crust that hides a creamy aioli over tender and juicy cod.
It's a dish that works equally well for an intimate dinner or for entertaining guests. It's quick to prepare, can be assembled in advance (the dish prepared in the fridge, ready to bake), and never disappoints.
For a perfect gratin, start with good cod. At Bacalalo, we select thick and juicy loins directly from the producer. Discover our collection of desalted cod and prepare this gratin with guaranteed success.
Desalted cod for your perfect gratin
Thick loins with skin, selected for oven and gratinating.
Buy desalted codFrequently asked questions
Can it be made with store-bought aioli?
Yes, it works. Commercial aioli gratins well because it has stable emulsifiers. But the flavor doesn't compare to homemade. If using store-bought, add an extra grated garlic clove to enhance the flavor.
How long do you bake cod au gratin?
15 minutes at 200 °C (400°F) to cook the cod, plus 3-5 minutes under the grill to gratinate the aioli. Total: 18-20 minutes. If using potatoes as a base, bake the potatoes for 10 minutes before adding the cod.
Does aioli curdle when broiled?
Aioli made with egg is very stable and will not curdle when baked. Traditional aioli (just garlic and oil) is more delicate but also holds up well to 3-5 minutes of grilling. What you should not do is bake for more than 20 minutes with aioli on top.
Can I prepare the dish in advance?
Yes. Assemble the dish with the potatoes, cod, and aioli and store it in the refrigerator for up to 4-6 hours. Take it out 15 minutes before baking so it's not too cold. It's ideal for dinners: you prepare it and bake it just before serving.
What kind of cod is best for broiling?
Thick fillets (3+ cm) with skin. Thickness is key: a thin fillet will dry out in the oven before the aioli gratinates. The skin helps retain moisture and adds gelatin. Desalted cod gives better results than fresh for this recipe.
Can I use fresh cod instead of desalted?
Yes, but season with salt before baking. Desalted cod has a firmer texture and a more concentrated flavor that works better with aioli. Fresh cod is milder and can be a bit bland in comparison.
How many calories does gratinéed cod with aioli have?
Approximately 520 kcal per serving with potatoes. Without potatoes, about 400 kcal. Most of the calories come from the aioli (olive oil), which provides healthy monounsaturated fats.
What wine pairs best with gratinéed cod?
A full-bodied white: Godello from Bierzo, barrel-fermented Verdejo, or a brut nature cava. The wine's acidity cuts through the fat of the aioli. Avoid powerful reds that mask the fish's flavor.
Marc González Sáez
Since 1990 in Mercat del Ninot, Barcelona. We select cod and seafood directly from the producer. It's not marketing — there are verifiable factors.




