Bacalao Encebollado: A Comforting Homemade Recipe Step by Step
Bacalao encebollado (cod with onions) is one of those recipes that proves the simplest cuisine can be the most extraordinary. A good cod loin, thinly sliced onions, and patience: that's all you need to create a dish that has comforted generations in homes across Spain.
But beware: simple doesn't mean easy. The secret to a memorable bacalao encebollado lies in the details that no one tells you about. In the speed at which you caramelize the onion. In the thickness of the cod cut. In the exact moment you remove the pan from the heat. Details that make the difference between an acceptable dish and one that makes you close your eyes in pleasure.
Since 1990, we have been selecting origin cod for homes and restaurants at the Mercat del Ninot in Barcelona. In this article, I share the recipe as we make it at home, with all the tricks we've learned in three generations working with this product. No shortcuts, no artifice.
History and tradition of bacalao encebollado
Bacalao encebollado has deep roots in Spanish cuisine, especially in the northern regions—Basque Country, Navarre, Cantabria—where salted cod was a fundamental protein for centuries. It wasn't a restaurant dish; it was survival food, pantry food, for fast days when the Church forbade meat.
The combination of cod and onion is no accident. Onion, cooked slowly until sweet and silky, offsets the cod's saltiness and provides a richness that turns an austere ingredient into a delicacy. Basque fishermen already prepared rudimentary versions of this dish on their boats, using onions as one of the few vegetables that would last weeks without spoiling.
Over time, each region developed its own version. In the Basque Country, green pepper is added; in Navarre, choricero pepper; in Catalonia, sometimes sofrito tomato is included. But the essence remains: cod + onion + time + olive oil. Four ingredients. An immortal recipe.
Today, bacalao encebollado remains one of the most sought-after dishes in Spanish cuisine. And for good reason: it's economical, comforting, easy to prepare in quantity, and, when done well, absolutely delicious. The kind of recipe they ask you to repeat every week.
Which cod cut to choose (and why it matters)
This is where most online recipes fail: they tell you "400g of cod" and that's it. But not all cod cuts work the same for encebollado. The difference between a mediocre and a spectacular result begins with the choice of the piece.
The loin: the ideal choice
For bacalao encebollado, the loin is the star cut. It is the thickest and meatiest part of the cod, at least 3-4 cm thick. Why does it matter? Because a thick loin allows you to cook the exterior until it forms a slight golden crust while the interior remains juicy, flaking into soft pieces that melt upon contact with the caramelized onion.
Thin cod—like tail or scraps—overcooks in seconds and becomes dry, fibrous, without the buttery texture we are looking for. For this dish, invest in a good loin. It's the difference between a 6 and a 10.
Our desalted cod, ready to cook
If you want to skip the desalting process (24-48 hours) and start directly with the recipe, our desalted cod loin arrives at your home with the perfect salt level. Pieces +4 cm thick, hand-selected. No preservatives, no additives.
Other cuts and when to use them
If you don't have loin, the miga (center of the cod, without skin or bones) is a worthy alternative, although somewhat drier. The tail, thinner, can work if you drastically reduce the cooking time. Scraps or shredded migas are another story: better reserve them for fritters or salads.
To learn more about the differences between cuts and how to choose according to your recipe, I recommend reading our guide on dried cod vs. desalted cod: which to buy for each recipe.
The secret to perfectly caramelized onions
Let's get to the point: the onion is the co-star of this dish, not a garnish. If you treat it as a mere accompaniment, the result will be mediocre. Here are the principles that make the difference.
Quantity: more than you think
The golden rule is to use twice the weight of onion as cod. Yes, double. The onion reduces by half or more during cooking, so if you start with 800g of onion for 400g of cod, you'll end up with a balanced proportion. If you fall short, the dish will be "cod with a little onion" instead of "bacalao encebollado."
Cut: fine julienne, always
Cut the onion into fine julienne (2-3 mm thick), following the natural grain of the bulb from pole to pole. Never in rings or brunoise. Fine julienne caramelizes evenly and creates those silky strands that wrap around the cod like a blanket.
Heat and patience: the ultimate key
Here's the secret no one wants to hear: the onion needs 30 to 45 minutes over low heat. No rushing. No turning up the heat "to make it go faster." If you turn up the heat, the onion will burn on the outside and remain raw on the inside. What you're looking for is a slow transformation: from translucent white to amber gold, passing through every intermediate shade.
Some tricks for perfect caramelization:
- Generous extra virgin olive oil: don't skimp. Oil conducts heat and adds flavor. At least 4-5 tablespoons for 800g of onion.
- Pinch of salt at the beginning: salt extracts moisture from the onion and slightly speeds up the process without burning.
- Stir every 5-7 minutes: not every 30 seconds (you'll cool it down) or every 15 minutes (it will stick). Every 5-7 minutes, a gentle stir with a wooden spoon.
- Lid ajar for the first 15 minutes: so the onion "sweats" and then uncover for it to evaporate and concentrate.
- Zero sugar: if you need to add sugar for the onion to taste sweet, you've gone too fast. The onion has plenty of natural sugars.
When the onion is golden, shiny, and has an aroma that perfumes the entire kitchen, you'll know it's ready. That unmistakable smell—sweet, deep, almost smoky—is the signal.
Complete recipe: bacalao encebollado step by step
Traditional Bacalao Encebollado
Prep time: 15 minutes | Cook time: 50 minutes | Servings: 4 | Difficulty: Easy
Ingredients
- 4 desalted cod loins, about 150-180g each (minimum 3cm thick)
- 800g onions (about 4-5 medium onions)
- 5-6 tablespoons extra virgin olive oil
- 2 cloves garlic (optional)
- 1 bay leaf
- 100 ml dry white wine
- Salt (sparingly, cod already has residual salt)
- Freshly ground black pepper
- Fresh chopped parsley for serving
- Flour for dusting (optional)
Step-by-step preparation
- Prepare the cod. If using salted cod, desalt it at least 24-48 hours in advance, changing the water every 8 hours (here's our complete guide to desalting cod). If using ready-to-use desalted cod, simply pat it dry thoroughly with paper towels. This step is crucial: moist cod won't sear properly.
- Caramelize the onion. Peel and thinly slice the onions into julienne. In a large skillet or shallow pot, heat 4 tablespoons of olive oil over medium-low heat. Add the onion, a pinch of salt, and the bay leaf. Cook for 30-45 minutes, stirring every 5-7 minutes, until the onion is golden and silky. In the last 5 minutes, add sliced garlic if using.
- Deglaze with wine. Increase heat to medium, pour in the white wine, and let it reduce for 2-3 minutes, scraping the bottom of the pan with a wooden spoon to incorporate any caramelized juices. Remove the onion and set aside.
- Sear the cod. In the same skillet (or a different one if you prefer), add 1-2 tablespoons of clean oil over medium-high heat. If you want a crispier crust, lightly dust the loins with flour, shaking off any excess. Place the loins skin-side up and cook for 3-4 minutes until a golden crust forms. Carefully flip them over and cook for another 2-3 minutes on the skin side.
- Combine and finish. Reduce heat to minimum. Distribute the caramelized onion over and around the cod loins. Cover the skillet and let them meld for 3-5 minutes. The gentle steam will finish cooking the interior of the cod without drying it out.
- Serve. Place each loin on a plate with a generous portion of onion on top and around it. Drizzle with the pan juices, sprinkle with fresh chopped parsley, and add a thread of raw extra virgin olive oil. Serve immediately.
Professional tip: Cod continues to cook off the heat due to residual heat. If, when you cut it, you see the center is slightly translucent, don't worry: it will be perfect by the time it reaches the plate. Cod that is opaque all the way through is overcooked. For more details on how to cook cod without overcooking it, check out our article on common mistakes when cooking cod and how to prevent it from becoming dry or breaking apart.
Variations: baked, with peppers, and other versions
The classic pan-fried recipe is the base, but bacalao encebollado allows for variations worth knowing. Each has its time and purpose.
| Variation | Method | Total time | Difficulty | Best for... |
|---|---|---|---|---|
| Classic pan-fried | Pan, low + medium heat | 50 min | Easy | Everyday, 2-4 people |
| Baked | Onion in pan + oven 180 °C | 60 min | Easy | Group meals, 6+ people |
| With peppers | Pan, green and/or red pepper | 55 min | Easy | More color and flavor, Basque style |
| With tomato | Tomato sofrito + onion | 55 min | Easy | Catalan version, juicier |
| Confit | Cod at low temperature in oil | 70 min | Medium | Special occasions, maximum juiciness |
Baked bacalao encebollado
The baked version is ideal when cooking for more than four people. The process is similar: caramelize the onion in a pan (you can't skip this), place it as a base in an oven-safe dish, put the cod loins on top, and bake at 180°C for 15-18 minutes. The advantage of the oven is that it cooks evenly, and you can prepare 6-8 portions at once without complication.
With peppers: Basque version
Add 2 green peppers cut into thin strips along with the onion from the beginning. The pepper needs the same slow cooking time. Some also add rehydrated choricero pepper, whose scraped pulp adds a smoky and sweet flavor that perfectly complements the cod. This version has more flavor complexity and a more striking visual appearance.
Confit version: for connoisseurs
If you want to take the dish to the next level, confit the cod. Submerge the loins in olive oil at 65-70°C for 20-25 minutes. The result is cod with an absolutely silky texture, which flakes apart at the slightest touch. Combine it with the caramelized onion and prepare for something memorable. If you are interested in mastering the gentle cooking technique of cod, don't miss our article on how to pan-fry cod without it drying out.
Common mistakes that ruin bacalao encebollado
After decades selling cod and hearing our customers' experiences, these are the mistakes we see over and over again:
- Too little onion. We've said it already, but we insist: twice the weight of onion as cod. Onions reduce drastically. If you start with too little, you end up with cod garnished with onion.
- Onion on high heat. This is the number one mistake. Burnt onion tastes bitter, not sweet. If you don't have 30 minutes, better make another recipe. There's no shortcut to caramelization.
- Poorly desalted cod. Cod that is too salty ruins any recipe, but in encebollado, it's especially serious because the sweet onion amplifies the perception of salt. Ensure proper desalting or use pre-desalted cod.
- Wet cod in the pan. If you don't pat the cod dry with paper towels before searing, the water creates steam instead of a crust. The result: boiled cod instead of golden.
- Overcooking. Cod goes from juicy to dry in a matter of a minute. A 4cm loin needs 3-4 minutes per side in a pan, no more. If it becomes completely opaque and starts releasing white liquid (albumin), you've overcooked it.
- Forgetting the resting time. Those final 3-5 minutes with the onion on top and the lid on are not optional. This is when the flavors meld and the inside of the cod reaches its perfect point due to residual heat.
To delve deeper into these and other common mistakes, I recommend our complete guide on common mistakes when cooking cod and how to avoid it becoming dry or breaking apart.
Pairing: what wine and accompaniments to choose
Bacalao encebollado is a dish with round flavors—the sweetness of the onion, the saltiness of the cod, the richness of the olive oil—and needs an accompaniment that complements without competing.
Wine
The natural choice is a full-bodied white wine. Some options that work very well:
- Godello (Valdeorras, Bierzo): mineral, with white fruit, enough structure to support the dish.
- Verdejo (Rueda): if you prefer something fresher and more aromatic. Choose a Verdejo aged on lees for more complexity.
- Garnacha Blanca (Terra Alta, Catalonia): round, unctuous, full-bodied. A spectacular pairing with caramelized onion.
- Albariño (Rías Baixas): the classic for fish, although for this dish we prefer something with more body than a young Albariño.
If you prefer red wine, a light young red—like a Mencía from Bierzo or an unoaked Garnacha—can work surprisingly well, especially with the version that includes peppers.
Accompaniments
Bacalao encebollado doesn't need much else, but these accompaniments elevate it:
- Patatas panaderas (sliced potatoes): the classic accompaniment. Cut them thin and cook them in the same pan before the cod, or bake them.
- Rustic bread: essential for dipping in the onion sauce. It's not optional.
- Simple green salad: some lettuce, arugula, or lamb's lettuce with a lemon dressing to provide freshness and contrast.
- Roasted piquillo peppers: if you haven't already incorporated them into the recipe, they go wonderfully on the side.
Frequently asked questions about bacalao encebollado
How long should the onion be caramelized for bacalao encebollado?
Between 30 and 45 minutes over low heat. There are no shortcuts. The onion should gradually go from translucent white to amber gold. If the onion still crunches when you bite it or has white tones, it's not ready. Be patient: the difference between a well-caramelized onion and a halfway one is the difference between a good dish and an exceptional one.
What cut of cod is best for encebollado?
The loin, without a doubt. It is the thickest and meatiest part of the cod, at least 3-4 cm thick. This allows it to be seared on the outside without drying out the inside. Miga is an acceptable alternative, but the tail and scraps are too thin for this dish. In our shop, you can find desalted cod loin with the ideal thickness.
Can I make bacalao encebollado with frozen cod?
Yes, but with nuances. Frozen cod releases more water when cooked, which makes it difficult to achieve a good golden crust. If using frozen, thaw it slowly in the refrigerator (never at room temperature or in the microwave) and pat it very dry with paper towels before cooking. That said, the result will never be the same as with fresh desalted cod: the texture is different, softer, and less flaky.
What wine pairs best with bacalao encebollado?
A full-bodied white wine like Godello, Garnacha Blanca, or aged Verdejo. The sweetness of the caramelized onion calls for a wine with structure and a certain unctuousness, not one that is too acidic or light. If you prefer red, opt for a young and light one like a Mencía from Bierzo.
Can I prepare bacalao encebollado in advance?
The caramelized onion, yes: you can prepare it up to 2 days in advance and store it in the refrigerator in an airtight container. In fact, it improves with resting. The cod, on the other hand, should be cooked just before serving. What you can do is have the onion ready, and when you're going to eat, sear the cod (5-7 minutes) and combine. This reduces the day's work to less than 15 minutes.
How many calories does bacalao encebollado have?
A generous serving of bacalao encebollado (180g of cod + caramelized onion) provides approximately 350-400 kcal. It is a dish rich in high-quality protein, healthy fats from olive oil, and low in carbohydrates. A nutritious and satisfying option for any balanced diet.
Can I make bacalao encebollado without flour?
Of course. Flour is completely optional. Its sole purpose is to help form a crispier crust when searing the cod. Without flour, the cod is equally delicious, with a softer, more natural sear. It's the perfect option if you're looking for a gluten-free recipe or simply prefer a cleaner result.
How much onion do I need per person?
Calculate about 200g of raw onion per person (approximately one medium-large onion). It seems like a lot, but remember that onions lose more than half their volume during slow cooking. If you have leftover caramelized onion, it keeps perfectly for 3-4 days in the refrigerator and is pure gold for sandwiches, pizzas, or fried eggs.
Conclusion: honest cooking needs no artifice
Bacalao encebollado proves that great dishes don't need long ingredient lists or cutting-edge techniques. They need quality produce and respect for timing. A good cod loin, onions cut with care, and the patience to let low heat work its magic for 30-45 minutes.
If there's one thing we've learned in over 30 years working with cod, it's that the raw material is everything. You can follow the recipe to the letter, but if you start with poor quality cod—thin, dry, poorly desalted—the result will be mediocre. Start with a good loin, treat it with respect, and the dish will make itself.
And if you want to explore more recipes with the same spirit—simple, honest, product-based—don't miss our collection of grandmother's cod recipes. Because the best recipes aren't invented: they're inherited.
Marc Gonzalez Saez
Third generation in the cod business. From the Mercat del Ninot in Barcelona, he selects the best origin pieces for clients and restaurants.




