Preheat the oven to 350°F (175°C). Grease and flour two 9-inch round cake pans (or three 8-inch pans), then line the bottoms with parchment paper for easy removal.
In a medium bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, nutmeg, ginger, and cloves until well combined. Set aside.
2 cups all-purpose flour, 2 teaspoons baking powder, 1 1/2 teaspoons baking soda, 1/2 teaspoon fine sea salt, 2 teaspoons ground cinnamon, 1/2 teaspoon ground nutmeg, 1/4 teaspoon ground ginger, 1/4 teaspoon ground cloves
In a large mixing bowl, whisk the granulated sugar, brown sugar, and eggs until slightly thickened and smooth, about 1–2 minutes by hand. Add the oil, applesauce, and vanilla; whisk again until the mixture looks emulsified and glossy.
1 cup granulated sugar, 1 cup light brown sugar, 4 large eggs, 1 cup neutral oil, 1/2 cup unsweetened applesauce, 2 teaspoons pure vanilla extract
Add the dry ingredient mixture to the wet mixture in two additions, folding gently with a spatula. Mix just until no visible streaks of flour remain to avoid overmixing and a dense cake.
Gently fold in the grated carrots, walnuts or pecans, and pineapple or shredded coconut (if using) until evenly distributed. The batter will be thick and full of mix-ins.
3 cups finely grated carrots, 1 cup chopped walnuts or pecans, 1/2 cup drained crushed pineapple or shredded coconut
Divide the batter evenly between the prepared cake pans. Smooth the tops with an offset spatula or the back of a spoon.
Bake at 350°F (175°C) for 25–30 minutes for two 9-inch pans or 20–25 minutes for three 8-inch pans. The cakes are done when a toothpick inserted in the center comes out with a few moist crumbs and the tops spring back lightly when touched.
Let the cakes cool in the pans for 10–15 minutes. Run a knife around the edges, then invert onto a wire rack. Peel off the parchment and allow to cool completely, about 45–60 minutes, before frosting.
In a large bowl, beat the softened cream cheese and butter with a hand mixer or stand mixer on medium speed until smooth and creamy, 2–3 minutes. Add powdered sugar 1 cup at a time, mixing on low until incorporated, then on medium until fluffy. Beat in vanilla and salt. Add 1–2 tablespoons of cream or milk as needed until the frosting is smooth and spreadable.
8 oz cream cheese, 1/2 cup unsalted butter, 3–3 1/2 cups powdered sugar, 2 teaspoons pure vanilla extract, 1/4 teaspoon fine sea salt, 1–2 tablespoons heavy cream or milk
If the cake layers have domed, use a serrated knife to gently level the tops. Place one layer on a serving plate, spread a generous layer of cream cheese frosting over the top, then add the second layer (and third, if using), repeating with frosting between each layer.
Apply a thin crumb coat of frosting around the sides and on top of the cake, then chill for 15–20 minutes to set. Finish with a thicker layer of frosting, swirling with an offset spatula. Decorate with extra chopped nuts, carrot curls, and a light sprinkle of cinnamon if desired.
extra chopped walnuts or pecans, grated carrot curls, ground cinnamon
Chill the frosted carrot cake for at least 1–2 hours before slicing for the cleanest layers and best flavor. Slice with a sharp, thin knife, wiping the blade between cuts, and serve slightly chilled or after resting at room temperature for 15–20 minutes.