Here’s the best carrot cake recipe you’ll ever eat! This carrot cake with pineapple and coconut is sweet and refreshing, flavored with delicious spices, with an ultra moist and tender texture. Top it off with a velvety cream cheese frosting, and don’t pass on the pecans for a crunchy bite. Perfect for any special occasion, this carrot cake recipe is a keeper!

Email me this recipe
We’ll send it straight to your inbox, along with weekly food inspiration!
Carrot cake is a classic in any family. It’s perfect for spring, Easter, a birthday party or any special occasion year round. To me, the perfect carrot cake must be sweet, flavored with cinnamon, with a perfectly moist crumb and a cream cheese frosting for some refreshing and tangy flavors. It also needs to be fluffy but holding its shape when slicing.

But there is more to it. Years ago, I discovered a little hack that makes any carrot cake taste utterly delicious, with the most tender and moist crumb you could possibly dream of. Best part? It is EASY TO MAKE! The recipe has now become a family favorite, and I can’t wait for you to try it too. You. will. fall. in. love.
Carrot cake with pineapple and coconut
Secret revealed! The one thing that makes the best ever carrot cake recipe is the addition of pineapple (yes, pineapple!) and coconut in the cake batter. It may sound odd at first, but once you try, you realize that pineapple is indeed a key ingredient for extra moistness and refreshing flavors. Paired with the shredded coconut, it adds some texture to the cake, together with the pecans. The result is light and delightful!

Why is it the BEST carrot cake recipe?
- Super moist and tender ✔
- Perfect balance of sweetness ✔
- Full of refreshing flavors ✔
- A crunchy bite added by the pecans ✔
- A smooth and tangy cream cheese frosting to top it off ✔

Ingredients to make the best carrot cake recipe
- Carrots. Use them fresh!
- Pineapple + shredded coconut. Pineapple adds some very refreshing flavors to the cake and participates to its extra moist crumb. Coconut brings some extra chewy texture.
- Granulated sugar + brown sugar. The combination of both sugars enables a sweet and moist carrot cake, that holds its shape when slicing.
- Eggs. They are the binding ingredient, helping the cake to hold its structure.
- Vegetable oil. Oil is the fat that keeps the cake nice and moist. Use canola oil, or any other vegetable oil neutral in taste.
- Buttermilk. It makes the carrot cake tender with a tangy flavor. Go for homemade buttermilk, it’s ready within minutes.
- All-purpose flour + baking soda. They will help the cake rise.
- Cinnamon + vanilla extract. They add a boost of flavors that makes the cake extra amazing.
- Pecans. For a little crunchy bite! You can use pecans, walnuts, or not use any nuts at all.
For the cream cheese frosting, you will need cream cheese, butter, heavy cream, and icing sugar, with some vanilla to boost the flavors.

How to make this carrot cake from scratch?
You may feel a little intimidated with the idea of making a layer cake at first, but please don’t. This carrot cake is very easy to make, and doesn’t require any fancy equipment. With just a couple of mixing bowls, a hand mixer and a rubber spatula, you can make it from scratch with (almost) no effort!
- Grate the carrots. Use fresh carrots and grate them yourself, using a grater or a food processor with a shredder attachment.
- Make the cake batter. It couldn’t be easier! All you need is to beat the wet ingredients with a hand mixer in one bowl, mix the dry ingredients in another bowl, and combine them together. Then, gently fold in the grated carrots, pineapple, coconut, and pecans, until evenly spread in the cake batter.
- Bake the cake. Start with dividing the cake in two equal parts, and bake them in two separate 9-inch (23 cm) baking pans. Make sure they are baked through, as an under-cooked inside would make the cake collapse when assembling.
- Prepare the frosting. When the carrot cake is in the oven, prepare the frosting by beating all the frosting ingredients. Make sure you use room temperature cream cheese and butter.
- Assemble the cake. Add a spoonful of cream cheese frosting in the center of a plate or cake stand, and place the first carrot cake on top. This will ensure the cake doesn’t move. Spread a generous layer of cream cheese over the cake, then top with the second cake and spread the cream cheese all over, including top and sides. Decorate with chopped pecans.

Tips for carrot cake success
- Use fresh carrots and grate them yourself. This will ensure the maximum of flavors. You can use a box grater, a food processor with a shredding blade, or a KitchenAid shredder attachment. In any case, do not purchase ready-to-use grated carrots, which tend to be on the drier side.
- Do not overmix the batter. Mix wet and dry ingredients until just combined, then gently fold the grated carrots, pineapple and shredded coconut with a rubber spatula until evenly spread.
- Properly divide the cake batter into two pans. I usually weigh the cake batter and divide the number in two. This is the best accurate way to have two equal size cakes.
- Monitor the baking time closely. The baking time can vary a little from one oven to another. Make sure the cake is baked through (a toothpick inserted in the center should come out clean). If the cake is under-cooked, it will be raw in the center and will collapse. If however it is over-cooked, the crumb will be dry.
- Layer off the tops of the cakes before assembling. Doing so ensures a very flat surface and make your layer cake easier to assemble.
- Make the carrot cake ahead of time. Carrot cake usually tastes better the next day, so it’s a great recipe to make ahead of time. Simply keep it covered in the refrigerator until ready to serve.
What if I don’t like pineapple or coconut?
Ok, so I’ve told the best carrot cake recipe involves pineapple and coconut. But if you are not a fan of pineapple and coconut, you can simply leave them out. You may not have the extra refreshing flavors and super moist texture, but I promise the carrot cake turn just fine. Same goes with the pecans.

How to store this carrot cake?
This carrot cake should be stored in the fridge, ideally in a cake carrier so it doesn’t dry out. When ready to serve, remove from the fridge and leave it at room temperature for about 20 minutes before serving (unless you prefer it cold). Leftovers can be stored in the refrigerator for up to 5 days. Unfrosted carrot cakes can be stored at room temperature and wrapped in plastic wrap for 2 days.
Freezing instructions. You can store slices of carrot cake, wrapped individually in plastic wrap, in the freezer. Alternatively you can freeze the unfrosted carrot cake, wrapped in cling film. Thaw at room temperature, then garnish and top with the cream cheese frosting.
More carrot cake recipes you’ll love:
- Easy Carrot Cake Loaf with Cream Cheese Frosting
- Carrot Cake Sandwich Cookies
- Skinny Carrot Cake Muffins with Coconut Cream
- Brown Butter Zucchini Carrot Cake

Add more veggies to your desserts!
Veggies always make the most wonderful and moist cakes, and also work well in cookies. Check these dessert recipes below, prepared with zucchini, carrots or beetroots!
- Chocolate Chip Zucchini Bread
- Red Velvet Beetroot Cake with Vanilla Frosting
- Healthy Chocolate Zucchini Bread
- Zucchini Chocolate Chip Cookies
Best Carrot Cake
- Prep Time: 30 mins
- Cook Time: 40 mins
- Total Time: 1 hour 10 minutes
- Yield: 10=12 servings 1x
- Category: Cakes and Pies
- Cuisine: American recipes
- Diet: Vegetarian
Here’s the best carrot cake recipe you’ll ever eat. This carrot cake with pineapple and coconut is sweet and refreshing, with an ultra moist and tender texture.
Email me this recipe
We’ll send it straight to your inbox, along with weekly food inspiration!
Ingredients
For the carrot cake:
- 2 cups (240g) all-purpose flour
- 2 teaspoons baking soda
- ½ teaspoon salt
- 2 teaspoons ground cinnamon
- 3 large eggs
- 1 cup (200g) caster sugar
- 1 cup (180g) brown sugar
- ¾ cup (180 ml) vegetable oil
- ¾ cup (180 ml) buttermilk*
- 2 teaspoons vanilla extract
- 2 cups (260g) grated carrot
- 8 ounces (225g)-canned crushed pineapple**, drained
- 1 ⅛ cup (85g) shredded coconut/coconut flakes
- 1 cup (150g) pecans, chopped*** + extra for decoration
For the cream cheese frosting:
- 1 cup (225g) cream cheese, softened at room temperature
- ½ cup (115g) unsalted butter, softened at room temperature
- Approx. 2 to 2 ½ cups (240 – 300g) confectioners’ sugar
- 2 Tablespoons heavy whipping cream
- 2 teaspoons vanilla extract
- 1 pinch of salt
Instructions
- Preheat the oven to 350°F (180°C). Grease two 9-inch (23 cm) cake pans, line with parchment paper, then grease the parchment paper and the sides.
- To make the cake, mix flour, baking soda, salt and cinnamon in a medium size bowl.
- In a separate large bowl, beat eggs, sugars, oil, buttermilk*, and vanilla on medium speed, until smooth, using a hand mixer. Add the flour mixture to the wet ingredients, beating on low speed until just combined. Fold in the carrots, pineapple, coconut and pecans.
- Divide the batter evenly**** into the prepared cake pans, and bake for about 40 mins, or until a toothpick inserted in the center comes out clean. Allow the cakes to cool completely before frosting and assembling.
- For the frosting, beat the cream cheese and butter together on medium speed for 2-3 minutes until soft and creamy. Add confectioners’ sugar, and beat until thick and combined. Pour in the heavy cream, vanilla, and beat on medium speed for 2 minutes. Add more confectioners’ sugar until desired thickness is reached. Add a pinch of salt, to taste and cut the sweetness.
- For assembling the carrot cake. Use a large serrated knife and layer off the tops of the cakes to create a flat surface. Add one Tablespoon of frosting in the center of the cake stand or serving plate, and place the first cake on top. Evenly cover the top with frosting. Top with the second layer, and spread the remaining frosting all over the top and sides. Decorate with extra pecans. Refrigerate cake for at least 30 minutes before slicing. Enjoy!
Notes
* To prepare homemade buttermilk, add 1 teaspoon of fresh lemon juice to a measuring cup, and cover with milk until you reach the ¾ mark. Stir, and let sit for 5 minutes. Your buttermilk is now ready to use!
** I recommend canned crushed pineapple for this recipe. Make sure you drain them well before using, to avoid the extra humidity in the cake.
*** Alternatively you can use chopped walnuts instead of pecans.
**** In order to divide the batter evenly, I usually weigh the cake batter and divide in two (keep in mind to substract the weight of the mixing bowl itself).
Did you make this recipe?
Lastly, if you make this Best Carrot Cake, be sure to leave a comment and give this recipe a rating, letting me know how you liked it. And of course, don’t forget to tag me on Instagram! Thank you and enjoy!

Elodie
Chère Delphine, voilà ça y est j’ai fait ta recette du carrot cake pour mon brunch de ce midi ! MAGNIFIQUE ! on sent pas l’ananas au goût, mais du coup la texture est parfaite et ce petit gout subtil de noix de coco hummmm … j’adore ! franchement la meilleure recette testée parmi toutes celles que j’ai réalisées. BRAVO, et merci vraiment de nous faire partager ton talent !
Anna
Well, it is 3 am Colorado USA time. Couldn’t sleep. Saw this Carrot Cake recipe. LOVE LOVE CARROT CAKE ! And this looks and sounds like the perfect recipe. Will bake this cake. Now on to sweet dreams for me tonite!
Delphine Fortin
Oh, thank you so much for your adorable comment, Anna. You made me laugh so much! I love your carrot cake cravings during the night 😉 Hope you had a chance to try the recipe!
Katerina
I am a big fan of carrot cakes and this one looks particularly scrumptious!
Delphine Fortin
Oh, I’m so happy to hear the carrot cake expert talking here. Thank you, Katerina! 🙂
Catherine
Dear Del, this cake is absolutely beautiful! I would just love a slice of this moist heavenly cake. xo, Catherine
Delphine Fortin
Wow, thank you for saying all these kind words about this cake! And you know what, I wouldn’t deny it, I am very proud of this carrot cake recipe. The very best I have ever had so far!!
Kathleen Strainis
That’s the same recipe my mom gave me years ago, 30 plus. And when I make it my two sons just couldn’t get enough, and myself included. Delicious, moist.
Delphine Fortin
Oh thank you for your very nice comment, I’m so happy that my carrot cake is a mom recipe and has been existing for so many years! 🙂 I absolutely adore this carrot cake: perfectly moist and so flavorful!
Linda (Meal Planning Maven)
We adore carrot cake and yours looks scrumptious! A must-try for sure!
Delphine Fortin
I am so glad you say that, please let me know if you try! 🙂
Diane
I agree carrot cakes should be moist, flavorful and coated with an awesome cream cheese frosting! I love what you’ve done with this old favorite recipe. I love those crunchy pecans too! Beautiful cake.
Delphine Fortin
Your description matches the one I had in mind when creating this recipe, so I guess we meet somewhere around this recipe 🙂
Joanne/WineLady Cooks
Lovely, carrot cake is one of my favorites.
Delphine Fortin
Same here! They are so flavorful, moist, and can be so elegant as well!
Janette@CulinaryGinger
This is so pretty and I love pecans with my carrot cake.
Delphine Fortin
Oh yes, to me pecans are a must. They are more delicate and flavorful than walnuts, although the last ones are cheaper…
Elizabeth
MMm nothing beats a good carrot cake and your recipe sounds divine! Will be trying this soon!
Delphine Fortin
I agree, a good carrot cake recipe in a house makes it perfect. And this recipe is definitely a keeper, I can guarantee you!
KC the Kitchen Chopper
I think carrot cake could make The Hubby a carrot cake lover! YUM!
Delphine Fortin
Haha, I am totally with you on it! 🙂
Nettie
Gorgeous cake and my favorite cake ever!
Delphine Fortin
I’m happy I found your favorite recipe, Nettie! 🙂
zeze
Generally I don’t learn article on blogs, however I would like to say that this
write-up very compelled me to take a look at and
do it! Your writing taste has been amazed me. Thanks, quite
great article.
Angela
Delphine, what a gorgeous cake!! I love carrot cake and this recipe sounds just perfect!!
Delphine Fortin
Oh, a carrot cake specialist who enjoy my recipe, I feel honored! 🙂
Kayana
Salut Del, j’adore les carrot cake! Ta recette à l’air délicieuse . bonne idée l’ananas et les noix de pecan!
Delphine Fortin
Merci beaucoup Kayana. Ravie que mon carrot cake te plaise!! 🙂
Contes et Délices
Moi qui raffole aussi de carrot cake, je suis comme hypnotisée par ta recette !! J’ai très envie de la tester 🙂
Delphine Fortin
Haha, j’aime beaucoup l’idée d’être hypnotisée pour un dessert. Je me reconnais bien là 🙂 Et je partage ton amour pour les carrot cakes!
sotis
bon ben je le garde au chaud, je n’ai jamais fais de carrot cake, c’est l’occasion ou jamais!!!! bisous
Delphine Fortin
Comment?! Toi qui a un blog magnifique et de très nombreuses recettes (d’ailleurs je m’en vais y faire un tour là), tu n’as jamais testé? 🙂 Alors je suis ravie de partager cette recette avec toi!
Mélina & Chocolat
Comme il est beau ! Il faut vraiment que je me lance dans la réalisation de ce fameux Carrot cake !!
Delphine Fortin
Merci Mélina, je suis sûre que tu vas adorer, c’est vraiment hyper bon!!
Rosenoisettes
Hello ! Je suis aussi d’accord, un carrot cake doit être moelleux et parfumé à la cannelle, avec de nombreuses noix.
Je n’ai jamais testé la version avec l’ananas, bien que ça fasse un moment que je me tâte !
Delphine Fortin
Eh bien voilà n’attends plus, cette recette est vraiment LA recette de carrot cake à tester et à conserver. Une petite tuerie! 🙂
Lara
Ça a l’air trop bon!
Comment tu convertis les cups en grammes stp? 🙂
Merci!!
Delphine Fortin
Tu peux aller voir la recette en version française (regarde le v’bouton tout en haut du site) et tu auras tout en mesures françaises 🙂
Marine
Même sur la version Fr, ça reste en cup pour la farine et le sucre. Quelle est la correspondance en gr ?
Superbe recette en tout cas que j’ai bien envie d’essayer !
Delphine Fortin
Oh toutes mes excuses en effet je n’avais pas vu (je n’ai que mon tel avec moi depuis hier, pas évident). Voilà qui est corrige, c’est bien 250g de farine! 🙂
Marine
Merci bcp !
Fortin Ludivine
Ahah elle ne manque pas de toupet la sœurette! 😉
Quelques rectifications s’imposent:
1) Le gâteau à la carotte n’est pas mon dessert préféré (bien que tes photos donnent l’eau à la bouche)
2) Je cuisine ! A ma modeste manière, certes, mais tout de même!
3) Ce n’est PAS le seul gâteau que j’ai réalisé dans ma vie, enfin! Le dernier est un divin fondant au chocolat que j’ai réalisé la semaine dernière ^^
Delphine Fortin
Haha, petits réglements de compte entre soeurs sur le blog (désolée pour mes lecteurs): bon eh bien en tous les cas, j’ai un si bon souvenir de ton gâteau à la carrote et tu l’avais tellement bien réussi que j’en ai construit tout un mythe autour, avec le sentiment que c’était ton préféré et que tu étais à ce point devenue experte que c’était carrément devenu le meilleur au monde que tu aies réalisé. Je me suis trompée visiblement… mais attends voir de tester celui-ci, et tu auras peut être cette sensation de nouveau 🙂