Moist Gluten-Free Carrot Cake with Cream Cheese Frosting
This gluten-free carrot cake is the one I bring to gatherings because it stays so moist and tender that nobody ever guesses it is wheat-free. Warm cinnamon, nutmeg, and fresh carrots do all the heavy lifting, while a tangy cream cheese frosting makes each slice feel special.

I have made this cake for birthdays, Easter, and casual Tuesday nights when a craving hits, and it never lets me down. The crumb is soft and light, with little pockets of walnut crunch, and the frosting sets up just firm enough to hold a swoop.
Why This Carrot Cake Is a Keeper
A good carrot cake needs real moisture, not just a sugary syrup. The combination of oil, freshly grated carrots, and a little crushed pineapple keeps this one soft for days, even in the fridge, without ever turning dense or gummy.
The spice blend is gentle, not aggressive, so you taste the carrot and the tangy frosting rather than just cinnamon. I also love that the gluten-free flour disappears into the background. There is no beany or gritty aftertaste, just classic carrot cake flavor.
Ingredients

- 2 cups gluten-free all-purpose flour blend: choose a blend that contains xanthan gum for structure
- 2 teaspoons baking powder: helps the cake rise
- 1 teaspoon baking soda: reacts with the brown sugar and pineapple for a tender crumb
- ½ teaspoon fine sea salt: brings out the sweetness
- 2 teaspoons ground cinnamon: the main warm spice
- ½ teaspoon ground ginger: a subtle kick
- ¼ teaspoon ground nutmeg: freshly grated if you have it
- 4 large eggs: room temperature, so they blend smoothly
- 1 cup granulated sugar: sweetness and structure
- ½ cup packed brown sugar: light or dark, for moisture and a hint of molasses
- 1 cup vegetable oil: a neutral oil like canola or sunflower, keeps the cake moist
- 2 teaspoons vanilla extract: rounds out the flavor
- 3 cups finely grated carrots: about 3 medium carrots, use the small holes of a box grater for the best texture
- ½ cup crushed pineapple, drained: optional, but adds extra moisture and a subtle sweetness
- 1 cup chopped walnuts or pecans: optional, toasted if you like
Cream Cheese Frosting
- 8 ounces full-fat cream cheese, softened: cold cream cheese will leave lumps, so let it sit out for an hour
- ½ cup unsalted butter, softened: room temperature
- 3 to 4 cups powdered sugar: sifted for a smooth frosting
- 1 teaspoon vanilla extract
- Pinch of fine sea salt: cuts the sweetness just enough
Variations / Substitutions
- Dairy-free frosting: use a plant-based cream cheese alternative and vegan butter, the frosting will be a little softer but still delicious
- Nut-free: simply leave out the walnuts, or swap in pumpkin seeds for crunch
- Sugar swap: swap the granulated sugar for coconut sugar to add a light caramel note, the cake will be slightly darker and a bit less sweet
- Spice it up: add ¼ teaspoon ground cloves or a pinch of cardamom for a cozy holiday twist
- Pineapple optional: if you skip the pineapple, the cake will still be moist, but you may notice the crumb is a touch less tender
If you want a classic wheat-based version, try my regular Carrot Cake recipe on the site.
How to Make Moist Gluten-Free Carrot Cake
Step 1: Mix the Dry Ingredients

In a large bowl, whisk together the 2 cups gluten-free flour, 2 teaspoons baking powder, 1 teaspoon baking soda, ½ teaspoon salt, 2 teaspoons cinnamon, ½ teaspoon ginger, and ¼ teaspoon nutmeg. Take about 30 seconds to whisk until the spices and leavening are evenly distributed, because any clump of baking soda will leave a bitter spot.
The mixture should look uniform with no streaks of white. I often give it a final sift if the flour blend tends to be lumpy, but a good whisk usually does the trick.
Step 2: Whisk the Wet Ingredients

In another large bowl, combine the 4 eggs, 1 cup granulated sugar, ½ cup brown sugar, and 1 cup oil. Whisk vigorously until the mixture is smooth and a little glossy, about 1 minute. Stir in the 2 teaspoons vanilla.
You are looking for a pale, thick liquid that flows like syrup off the whisk. This step builds the cake’s structure, so stop once it is fully combined and no oil separates out.
Step 3: Fold in the Carrots and Pineapple

Pour the dry ingredients into the wet ingredients and fold gently with a spatula. Stop as soon as no streaks of flour remain, about 20 to 30 seconds of folding. Overmixing will work the xanthan gum too hard and make the cake tough.
Switch to a light hand and fold in the 3 cups grated carrots, the drained crushed pineapple, and the walnuts, if using. The batter will look thick and nubby with orange flecks, and it will smell warmly of cinnamon and carrot.
Step 4: Bake the Cake

Preheat the oven to 350°F (175°C) while the batter rests for a few minutes. Grease two 9-inch round cake pans and line the bottoms with parchment paper. Divide the batter evenly between the pans, smoothing the tops with your spatula.
Bake until the tops are golden and a toothpick inserted in the center comes out clean, about 25 to 30 minutes. The cakes will start to pull away from the sides of the pans and spring back when lightly pressed in the center.
Let the cakes cool in the pans on a wire rack for 10 minutes, then turn them out onto the rack to cool completely. Frosting a warm cake will melt the cream cheese, so give them at least an hour to come to room temperature.
Step 5: Frost and Serve

While the cakes cool, beat the softened cream cheese and butter together until creamy and smooth, about 2 minutes. Gradually add the powdered sugar, 1 cup at a time, along with the vanilla and salt. Beat on low until combined, then increase speed and whip for a minute until light and fluffy.
Place one cooled cake layer on a serving plate and spread about a cup of frosting over the top. Set the second layer on top and cover the whole cake with the remaining frosting, using an offset spatula to create swoops. Slice and serve at room temperature, with any stray walnut pieces scattered on top for a little extra crunch.
Tips for the Best Gluten-Free Carrot Cake
- Grate the carrots yourself using the fine holes of a box grater. Pre-shredded bagged carrots are too dry and thick, and they will not melt into the crumb the same way.
- Toast the walnuts in a dry pan for 3 to 4 minutes until fragrant. It deepens their flavor and keeps them crisp, even after the cake sits in the fridge.
- Bring the eggs, cream cheese, and butter to room temperature. Cold ingredients do not emulsify well, and cream cheese straight from the fridge will leave lumps in the frosting.
- Do not overmix once the flour hits the wet ingredients. Fold just until combined, because gluten-free blends with xanthan gum can turn gummy if beaten.
Here are bake times for different pans:
| Pan | Material | Time |
|---|---|---|
| Two 9-inch rounds | Light aluminum | 25 to 30 mins |
| Two 8-inch rounds | Light aluminum | 30 to 35 mins |
| One 9×13-inch sheet | Light metal | 30 to 35 mins |
| Cupcakes (18 to 24) | Standard muffin tin | 18 to 22 mins |
Keeping This Carrot Cake Fresh
- Refrigerate: Cover the frosted cake loosely and store in the refrigerator for up to 5 days. The cream cheese frosting needs to stay cold.
- Serve at room temperature: Take slices out 30 minutes before eating. The frosting softens and the cake reclaims its tender crumb when it is not icy cold.
Frequently Asked Questions
Can I bake the cake layers ahead of time?
Yes. Wrap the completely cooled, unfrosted layers tightly in plastic wrap and freeze for up to 2 months. Thaw in the fridge overnight, then frost and serve.
Can I use coconut oil instead of vegetable oil?
You can, but refined coconut oil works best because it has no coconut flavor. Unrefined coconut oil will add a mild tropical note that can compete with the spices.
Why did my cake sink in the middle?
This usually means the batter was overmixed, the oven door was opened too early, or the cake was not baked long enough. Make sure the toothpick comes out clean before pulling it from the oven.
Do I have to add the crushed pineapple?
No, you can leave it out. The cake will still be moist from the carrots and oil, but the crumb may be just slightly less tender, especially on day two.

Gluten Free Carrot Cake Recipe
Ingredients
Method
- Whisk together the flour, baking powder, baking soda, salt, and spices in a large bowl.
- In another bowl, whisk the eggs, sugars, oil, and vanilla until smooth.
- Fold the dry ingredients into the wet, then fold in the carrots, pineapple, and walnuts.
- Divide between two greased 9-inch pans and bake at 350°F until a toothpick comes out clean, 25 to 30 minutes. Cool completely.
- Beat the cream cheese and butter, then add powdered sugar, vanilla, and salt. Frost the cooled cake and serve.
