Preheat your oven to 350°F (175°C). Grease two 9-inch cake pans or one 9x13 inch baking dish with butter or cooking spray.
In a medium bowl, sift together the flour, baking powder, baking soda, cinnamon, nutmeg, and salt. Mix well and set aside.
In a large mixing bowl, beat together the grated carrots, vegetable oil, granulated sugar, brown sugar, eggs, and vanilla extract until well combined.
Add the dry ingredients to the wet ingredients, mixing until just combined. Stir in the chopped walnuts (if using).
Pour the batter into the prepared cake pans or baking dish.
Bake for 25-30 minutes for the cake pans or 35-40 minutes for the baking dish, or until a toothpick inserted into the center of the cake comes out clean.
Let the cakes cool completely in the pans before removing and frosting.
Spread a layer of cream cheese frosting over one cake layer, then place the second cake layer on top and frost the top and sides of the cake.
Serve and enjoy your delicious carrot cake!
Check out the products below to make this recipe!