Cakes
The Best Carrot Cake Recipe with Cream Cheese Frosting
By Trevor · Updated · 2 hours total · One 2-layer 9-inch cake (16 slices)
In a nutshell
The best carrot cake is made with oil rather than butter for a moist crumb that stays soft for days, three cups of finely grated fresh carrots, a mix of brown and white sugar, cinnamon, nutmeg and ginger, and toasted pecans. Bake two 9-inch layers at 350°F for 30 to 35 minutes and frost with a simple cream cheese frosting made from cream cheese, butter, powdered sugar and vanilla.

This is the carrot cake that gets requested for birthdays, Easter and every spring gathering at our house. It is deeply moist without being heavy, fragrant with cinnamon and a little nutmeg and ginger, full of finely grated carrots and toasted pecans, and covered in a cream cheese frosting that is tangy enough to balance all that sweetness.
Carrot cake is one of the most forgiving cakes you can bake. There is no creaming of butter, no fussing over temperature, just two bowls and a whisk. The one job that takes a little time is grating the carrots, and a food processor makes short work of it.
I have tested this with and without pineapple, with walnuts and pecans, and as a sheet cake, a layer cake and cupcakes. The version below is the one I keep coming back to, with the alternatives noted so you can make it your own.
Why this recipe works
- Oil instead of butter keeps the crumb moist and tender for days, since oil stays liquid at room temperature.
- Finely grated carrots melt into the cake and release moisture as it bakes; coarsely grated ones stay stringy.
- Brown sugar adds a caramel depth and extra moisture that white sugar alone cannot.
- A restrained hand with the spices lets the carrots and toasted nuts come through instead of tasting like a spice cake.
- Cream cheese frosting made with cold cream cheese and just enough powdered sugar stays firm, pipeable and tangy.
Ingredient notes and substitutions
Buy whole carrots and grate them yourself on the small holes of a box grater or with the fine shredding disc of a food processor. Bagged pre-shredded carrots are dry and coarse, and they never soften properly in the cake. You will need about 4 to 5 medium carrots for 3 cups.
Vegetable, canola or a light olive oil all work. Melted coconut oil works too but will give a faint coconut flavor. I do not recommend butter here; the cake will be drier and firmer.
Pecans are my favorite, toasted for 8 minutes at 350°F to bring out their flavor. Walnuts are the classic alternative. Leave the nuts out entirely for a nut-free cake; it will still be excellent.
The crushed pineapple is optional. It adds extra moisture and a subtle brightness, but the cake is plenty moist without it. If you use it, drain it very well and press out the juice.
How to make cream cheese frosting that holds its shape
Runny cream cheese frosting is the most common carrot cake problem, and it comes from over-softened cream cheese. Use full-fat brick cream cheese, not the whipped tub kind, and let it soften only slightly, about 20 minutes on the counter. Beat the butter first until smooth, add the cream cheese and beat just until combined, then add the sugar. Overbeating cream cheese thins it out.
If the frosting is still too soft to spread, refrigerate it for 20 to 30 minutes and stir it before using. If you want a stiffer frosting for piping, add up to 1 more cup of powdered sugar.
Layer cake, sheet cake or cupcakes
- Two 9-inch round layers (as written): bake 30 to 35 minutes.
- Three 8-inch round layers: bake 25 to 28 minutes for a taller cake.
- 9x13-inch sheet cake: bake 40 to 45 minutes. Frost right in the pan. This is the easiest option for a crowd.
- 24 cupcakes: fill liners two-thirds full and bake 20 to 22 minutes.
- Bundt cake: bake 55 to 65 minutes in a well-greased 10-cup Bundt pan and drizzle with thinned frosting.
Make-ahead tips
Carrot cake is a great make-ahead cake because it actually improves after a day. Bake the layers up to 2 days ahead, wrap them well once cool, and keep them at room temperature or in the refrigerator. The frosting can be made 3 days ahead and refrigerated; let it soften for 20 minutes and stir before spreading. The finished cake keeps for 5 days in the refrigerator and tastes best served at cool room temperature.
How to store carrot cake
- Store the frosted cake covered in the refrigerator for up to 5 days. Let slices sit out for 15 to 20 minutes before serving.
- Unfrosted layers keep wrapped at room temperature for 2 days or frozen for up to 3 months.
- Frosted slices can be frozen on a tray until firm, then wrapped, for up to 2 months. Thaw overnight in the refrigerator.
Variations to try
- Raisins: fold in 3/4 cup of raisins or golden raisins with the carrots.
- Coconut: add 3/4 cup sweetened shredded coconut for a Southern-style carrot cake.
- Brown butter frosting: brown the 1/2 cup of butter, chill until solid, then proceed with the frosting recipe for a nutty depth.
- Nut-free: leave out the nuts entirely; no other changes are needed.
Frequently asked questions
- Why is oil better than butter in carrot cake?
- Oil stays liquid at room temperature, so the cake stays moist and soft for days, while butter firms up as it cools and makes the crumb tighter and drier. Carrot cake gets its flavor from the carrots, spices and brown sugar rather than from butter, so nothing is lost.
- Can I use pre-shredded carrots from the store?
- It is best not to. Bagged shredded carrots are thick and dry and stay crunchy in the finished cake. Fresh carrots grated on the small holes of a box grater melt into the crumb and add moisture.
- Why is my cream cheese frosting runny?
- The cream cheese was too warm, or it was beaten too long, or it was the whipped tub kind rather than the brick. Use brick cream cheese softened for only about 20 minutes, beat it just until smooth, and chill the frosting for 20 to 30 minutes if it is still soft.
- Can I make carrot cake as a sheet cake?
- Yes. Pour the batter into a greased 9x13-inch pan and bake at 350°F for 40 to 45 minutes. Cool completely in the pan and frost right in the pan. It is the easiest way to serve a crowd.
- Does carrot cake need to be refrigerated?
- Once frosted, yes, because the cream cheese frosting is perishable. It will keep for up to 5 days covered in the refrigerator. Unfrosted layers can sit at room temperature for 2 days.
- Can I make this carrot cake gluten-free?
- Yes. Replace the all-purpose flour with an equal weight of a measure-for-measure gluten-free flour blend that contains xanthan gum. The texture is very close because carrot cake does not rely heavily on gluten for structure.
Recipe card
The Best Carrot Cake Recipe with Cream Cheese Frosting
The best carrot cake recipe: incredibly moist, warmly spiced, packed with fresh carrots and toasted pecans, and covered in tangy cream cheese frosting. Two 9-inch layers, printable card.
By Trevor · Updated

- Prep
- 30 minutes
- Cook
- 35 minutes
- Total
- 2 hours
- Makes
- One 2-layer 9-inch cake (16 slices)
Includes about 1 hour of cooling before frosting
Ingredients
For the cake
For the cream cheese frosting
Equipment
- Two 9-inch round cake pans
- Parchment paper
- Box grater or food processor
- Two large mixing bowls
- Whisk and spatula
- Electric hand mixer or stand mixer
- Wire cooling rack
- Offset spatula for frosting
Instructions
Prepare the pans
Preheat the oven to 350°F (175°C). Grease two 9-inch round cake pans, line the bottoms with parchment paper, and grease the parchment.
Whisk the dry ingredients
In a large bowl, whisk together the flour, baking soda, baking powder, salt, cinnamon, nutmeg and ginger.
Whisk the wet ingredients
In another large bowl, whisk the oil, granulated sugar and brown sugar until combined. Add the eggs one at a time, whisking well after each, then whisk in the vanilla. The mixture should look smooth and glossy.
Combine and fold in the carrots
Pour the dry ingredients into the wet and whisk just until no flour streaks remain. Switch to a spatula and fold in the grated carrots, the nuts and the pineapple, if using.
Tip: The batter will be fairly thick and speckled with carrot. Do not overmix.
Bake
Divide the batter evenly between the pans and smooth the tops. Bake for 30 to 35 minutes, until the cakes are golden, spring back when lightly pressed, and a toothpick inserted in the center comes out clean.
Cool completely
Cool the cakes in their pans for 15 minutes, then run a knife around the edges, turn them out onto a wire rack, peel off the parchment, and cool completely, about 1 hour. Warm cake will melt the frosting.
Make the frosting
Beat the butter with an electric mixer until smooth, about 1 minute. Add the cream cheese and beat just until combined and smooth, about 30 seconds. Add the powdered sugar, vanilla and salt and beat on low until incorporated, then on medium for 1 minute until fluffy. If the frosting is soft, refrigerate it for 20 minutes.
Assemble and frost
Place one layer on a serving plate. Spread about 1 cup of frosting evenly over the top. Add the second layer, then frost the top and sides with the remaining frosting. Press chopped pecans around the base or sprinkle over the top, if you like.
Chill briefly and serve
Refrigerate the cake for at least 30 minutes to set the frosting, which makes it far easier to slice cleanly. Let slices sit for 15 minutes before serving for the best texture.
Notes
- Grate the carrots finely and freshly. Bagged shredded carrots are too dry and coarse.
- Make sure the layers are completely cool before frosting or the frosting will slide off.
- Use brick-style cream cheese, softened only slightly, for frosting that holds its shape.
Nutrition (per serving, estimated)
| Calories | 590 |
|---|---|
| Fat | 33 g |
| Saturated fat | 10 g |
| Carbohydrates | 70 g |
| Fiber | 2 g |
| Sugar | 53 g |
| Protein | 6 g |
| Sodium | 400 mg |
| Cholesterol | 85 mg |
Serving size: 1 of 16. Nutrition is calculated from standard ingredient data and will vary with brands and substitutions.
Recipe from Sunny Side Kitchen · https://trevorfarias.com/recipes/carrot-cake
More recipes you might like

Muffins
The Best Blueberry Muffins Recipe (Bakery-Style, Tall and Moist)
The best blueberry muffins: tall bakery-style domes, moist buttermilk crumb, bursting with berries and topped with buttery streusel.
- Total:
- 40 minutes
- Makes:
- 12 large muffins

Bread
The Best Sourdough Bread Recipe for Beginners
The best sourdough bread recipe for beginners: 4 ingredients, no kneading, and a crisp crust with a soft, open crumb.
- Total:
- About 24 hours
- Makes:
- 1 round loaf (12 slices)

Quick Breads
The Best Buttermilk Cornbread Recipe (Moist, Tender, Golden)
The best cornbread recipe: moist, tender buttermilk cornbread with crisp golden edges, baked in a cast-iron skillet in 25 minutes.
- Total:
- 35 minutes
- Makes:
- One 10-inch skillet or 9-inch square pan (9 pieces)