Bake a moist Carrot Cake Recipe with spiced batter and cream cheese frosting for a crowd-pleasing dessert.
Preheat the oven to 350°F (175°C). Lightly grease a 9×13-inch rectangular baking pan with a tablespoon of softened unsalted butter, and if you like, line the bottom with a sheet of parchment paper that is also lightly buttered so the cake releases cleanly. Keep the greased pan nearby; this small bit of preparation makes the final unmolding effortless and keeps the rectangular geometry consistent through the process.
Spread the walnut halves or pieces in a single layer on a baking sheet and toast in the preheated oven until fragrant and lightly golden, about 8–10 minutes, stirring once halfway. Remove and let cool completely on the sheet, then roughly chop the toasted nuts if they aren’t already in pieces. Reserve a small handful of the toasted pieces for garnish so the toasty crunch is visible on the finished cake.
Peel the carrots and finely grate them using the small holes of a box grater or a fine shredding disk; measure about 3 firmly packed cups (≈330 g) of bright orange, finely textured grated carrot. If using crushed pineapple, drain thoroughly and squeeze out excess moisture in a towel; if using raisins, briefly rehydrate in hot water for 5 minutes and pat dry. Gather the prepped grated carrots, drained pineapple, raisins, and the cooled toasted walnuts in separate small bowls so they are ready to fold into the batter.

In a medium mixing bowl, whisk together the all-purpose flour, baking powder, baking soda, fine sea salt, ground cinnamon, ground ginger, freshly grated nutmeg, and ground cloves (if using). Whisk until the mixture is uniform and the spices are evenly distributed—this dry blend should be pale, powdery, and aromatically spiced with tiny pinpricks of nutmeg and cinnamon. Set the bowl aside for easy folding with the wet mixture.

In a large matte-grey mixing bowl, combine the room-temperature vegetable oil, eggs, packed light brown sugar, granulated sugar, and vanilla extract. Whisk vigorously (by hand or with a mixer) until the mixture is smooth, slightly thickened, and fully emulsified—no visible streaks of egg, and the sugars mostly dissolved into a glossy, amber-tinted batter base. If using crushed pineapple, fold it into this wet mixture now so its moisture integrates evenly.

Add the dry flour-and-spice mixture to the wet mixture in two to three additions, folding gently with a flexible spatula or on low mixer speed. Work just until no visible pockets of dry flour remain—scrape the sides and bottom so everything is evenly incorporated. The goal is a thick, cohesive batter that still feels airy; overmixing will tighten the crumb.
Fold the finely grated carrots, the cooled chopped toasted walnuts (hold back some for garnish), and the raisins (if using) into the batter until they are evenly distributed—look for thin orange strands and dark raisin flecks suspended throughout a thick, textured batter. Scrape the batter into the prepared 9×13-inch pan with an offset spatula, smooth the top into an even layer, and tap the pan firmly on the counter 2–3 times to release air bubbles. The batter should be visibly studded with carrots and walnuts and should hold its shape in the rectangular pan.

Bake in the preheated oven until the top is set and springy and a toothpick inserted into the center comes out with a few moist crumbs but no wet batter—about 30–35 minutes for a 9×13 pan. Remove to a wire rack and let the cake cool completely in the pan, about 1½ hours; cooling fully is essential so the cream cheese frosting won’t melt when applied.
While the cake cools, beat the room-temperature unsalted butter until smooth, then beat in the room-temperature cream cheese until the mixture is glossy and without lumps. Add fine sea salt and half of the sifted powdered sugar, blend on low to start, then add the remainder until the frosting is thick and creamy. Stir in vanilla and 2–3 tablespoons of heavy cream or milk until the frosting is smooth, silky, and spreadable; adjust with a teaspoon of cream at a time if needed.
Spread the cream cheese frosting evenly over the completely cooled rectangular cake using an offset spatula, creating gentle swirls or a smooth top. Sprinkle the reserved toasted walnut pieces around the edges and a light scattering of unsweetened shredded coconut; finish with a few delicate carrot ribbons or a pinch of extra finely grated carrot for color. Allow the frosted cake to sit at room temperature for 20–30 minutes before slicing into clean rectangular pieces using a warm, wiped knife. Refrigerate leftovers in an airtight container for up to five days.
