This moist carrot cake with pineapple takes the classic spice cake you know and adds crushed pineapple for a tender, tropical crumb. The pineapple's natural sugars and acidity keep the cake exceptionally soft for days, while the carrot and warm spices balance the sweetness. It is a straightforward two-layer cake that bakes in under an hour and needs no special equipment beyond two 8-inch round pans.
Ingredients
- 2 cups (250 g) all-purpose flour
- 2 teaspoons baking soda
- 1 teaspoon baking powder
- 1½ teaspoons ground cinnamon
- ½ teaspoon ground ginger
- ¼ teaspoon ground nutmeg
- ½ teaspoon salt
- 3 large eggs, room temperature
- 1 cup (200 g) granulated sugar
- ½ cup (100 g) packed light brown sugar
- ¾ cup (180 ml) neutral oil, such as canola or vegetable
- ½ cup (120 g) plain Greek yogurt or sour cream, room temperature
- 2 teaspoons vanilla extract
- 2½ cups (250 g) finely grated carrots (about 3 medium carrots)
- 1 cup (240 g) crushed pineapple, drained well (reserve 2 tablespoons juice for frosting if desired)
- ½ cup (60 g) chopped walnuts or pecans, optional
- ½ cup (60 g) raisins, optional
For the cream cheese frosting:
- 8 oz (225 g) full-fat cream cheese, softened
- ½ cup (115 g) unsalted butter, softened
- 3 cups (360 g) powdered sugar, sifted
- 1 teaspoon vanilla extract
- 1–2 tablespoons reserved pineapple juice or milk, as needed
- Pinch of salt
Instructions
- Preheat the oven to 350°F (175°C). Grease two 8-inch (20 cm) round cake pans, line the bottoms with parchment paper, and grease the parchment. Lightly flour the pans and tap out the excess.
- In a medium bowl, whisk together the flour, baking soda, baking powder, cinnamon, ginger, nutmeg, and salt. Set aside.
- In a large bowl, whisk the eggs and both sugars until smooth and slightly pale, about 1 minute. Whisk in the oil, yogurt (or sour cream), and vanilla until fully combined.
- Add the dry ingredients to the wet ingredients in two additions, folding with a spatula just until no dry streaks remain. Do not overmix.
- Fold in the grated carrots, drained crushed pineapple, and optional nuts and raisins until evenly distributed. The batter will be thick and moist.
- Divide the batter evenly between the prepared pans (about 2½ cups per pan) and smooth the tops with a spatula.
- Bake for 28–34 minutes, until a toothpick inserted into the center comes out clean or with just a few moist crumbs. Rotate the pans halfway through if your oven bakes unevenly.
- Cool the cakes in the pans on a wire rack for 10 minutes, then turn out onto the rack, remove the parchment, and cool completely before frosting, at least 1 hour.
- For the frosting, beat the softened cream cheese and butter with an electric mixer on medium speed until smooth and creamy, about 2 minutes. Add the powdered sugar, vanilla, and salt, and beat on low until incorporated, then on medium-high for 1–2 minutes until fluffy. Add reserved pineapple juice or milk a teaspoon at a time if the frosting is too stiff.
- Place one cake layer on a serving plate, spread about ¾ cup frosting over the top, and set the second layer on top. Spread the remaining frosting over the top and sides. Refrigerate for 30 minutes to set before slicing.
Tips
- Drain the pineapple thoroughly. Press it in a fine-mesh sieve or squeeze it in a clean kitchen towel. Excess liquid makes the batter wet and the cake gummy. Reserve a little juice for the frosting if you like.
- Grate carrots finely. Use the small holes of a box grater or a food processor. Large shreds can stay firm and create pockets in the crumb.
- Do not overmix. Fold just until the flour disappears. Overmixing develops gluten and produces a dense, rubbery cake.
- Frost a fully cooled cake. Even slightly warm layers will melt the cream cheese frosting. If short on time, chill the layers in the refrigerator for 20 minutes before frosting.
Serving Suggestions
Serve the cake slightly chilled or at cool room temperature. It pairs well with a cup of black coffee, chai, or a glass of cold milk. For a dessert table, add a scoop of vanilla ice cream or a spoonful of whipped cream. A light dusting of cinnamon or a few toasted coconut flakes on top of the frosting adds a tropical touch. If you are serving outdoors or in a warm room, keep the cake refrigerated until serving and set it out for no more than 2 hours.
Variations
- Coconut carrot cake: Add ½ cup (40 g) unsweetened shredded coconut to the batter and toast 2 tablespoons for the top.
- Pineapple upside-down option: Arrange drained pineapple rings and a sprinkle of brown sugar in the bottom of the pans before adding batter for a decorative top.
- Nut-free: Omit the walnuts or pecans and increase the raisins to ¾ cup if desired.
- Sheet cake: Bake the batter in a greased 9×13-inch pan for 35–40 minutes, then frost once cool.
- Less sweet frosting: Reduce the powdered sugar to 2½ cups and add an extra pinch of salt; the frosting will be softer, so chill the cake well before slicing.
Storage and Reheating
Store the frosted cake covered in the refrigerator for up to 4 days. For best texture, let it sit at room temperature for 15–20 minutes before serving. Unfrosted cake layers can be wrapped tightly in plastic wrap and stored at room temperature for up to 2 days, or frozen for up to 2 months; thaw overnight in the refrigerator before frosting. Frosting can be made ahead and refrigerated for up to 3 days; bring it to room temperature and rebeat briefly before using. To freeze slices, wrap each piece individually and freeze for up to 2 months; thaw in the refrigerator overnight. Do not leave cream cheese frosting or the frosted cake at room temperature for more than 2 hours.
Frequently Asked Questions
Can I use fresh pineapple instead of canned?
Yes, but fresh pineapple contains an enzyme that can break down proteins and may affect the crumb. Use finely chopped fresh pineapple that has been drained well, and consider blanching it for 1 minute and cooling before folding into the batter. Canned crushed pineapple in juice is the most reliable choice for consistent moisture.
Why is my carrot cake dry?
Dryness usually comes from overbaking or from squeezing too much moisture out of the carrots. Grate carrots fresh and do not press them dry. Check the cake at the lower end of the baking range and pull it when a toothpick comes out with a few moist crumbs, not completely clean.
Can I make this cake ahead of time?
Yes. Bake and cool the layers, wrap them tightly, and refrigerate for up to 2 days or freeze for up to 2 months. Frost the cake the day you plan to serve it for the best texture. The frosting can be made up to 3 days ahead and refrigerated.
How do I keep the cake from sticking to the pans?
Grease the pans, line the bottoms with parchment, and grease the parchment again. A light dusting of flour helps, but do not skip the parchment—carrot cake is moist and tender and clings easily. Run a thin knife around the edge after 10 minutes of cooling before turning out.
Is it safe to leave cream cheese frosting out?
No. Cream cheese frosting contains dairy and should be refrigerated. Do not leave the frosted cake at room temperature for more than 2 hours. If serving outdoors in warm weather, keep the cake in a cooler or refrigerate until just before serving.
Can I reduce the sugar?
You can trim the granulated sugar by up to ¼ cup without major changes, but the cake relies on sugar for moisture and browning. Reducing it further may make the crumb drier. If you prefer a less sweet cake, reduce the frosting sugar instead, as noted in the variations.