Thick, smooth, and creamy, this chocolate pastry cream (aka chocolate crème pâtissière) can be used in cakes, pastries, and other desserts. Prepared on the stovetop with just 7 ingredients, it has a rich chocolate flavor and just the right amount of sweetness.

This chocolate pastry cream recipe is the chocolate counterpart to my vanilla pastry cream. It’s made with the same process and ingredients, with the addition of chopped bittersweet chocolate. It’s just as tasty as my original crème pâtissière but a little thicker, due to the chocolate thickening the cream a little more as it cools.
The best part is the great chocolate flavor. The sweetness and richness of the cream is balanced nicely by the bittersweet chocolate. It’s not overwhelmingly sweet, just sweet enough, so it works well with other desserts. It’s a nice alternative to vanilla pastry cream in cakes and pastries!

Why I Love This Chocolate Pastry Cream Recipe
- Made with melted chocolate. Some recipes use cocoa powder to add chocolate flavor to pastry cream, but I opted to go for chopped chocolate. It melts into the mixture, thickening it just a tad, while keeping the smooth, creamy texture. I opted for bittersweet chocolate to balance the overall sweetness.
- Thick and creamy. As I noted above, this chocolate pastry cream is a bit thicker than my vanilla pastry cream, but it’s just as smooth and creamy. I think the thicker texture makes it perfect for adding to cakes and other desserts.
- Versatile. The thick texture and sweet but not too sweet flavor make this pastry cream ideal for so many desserts, from layer cakes and trifles to cream puffs and eclairs.
Ingredient Notes
Here’s an overview of the 7 ingredients needed to make this recipe and why each one is important. Be sure to scroll down to the recipe card for the exact measurements.

- Egg yolks – To thicken the cream. Be sure to use large eggs and carefully separate the yolks. Whole eggs make the cream more runny, while the yolks add flavor and structure.
- Sugar – Adds sweetness to the pastry cream.
- Cornstarch – Thickens the cream along with the egg yolks. Cornstarch works better than flour in this recipe because you need a much smaller amount and it doesn’t change the flavor or texture.
- Whole milk – I don’t recommend any substitutions here, as the high fat content in whole milk is necessary to maintain the thick and creamy texture.
- Unsalted butter – Adds flavor to the cream.
- Vanilla extract – Also adds flavor and helps to balance the bitterness of the chocolate.
- Chocolate – Bittersweet chocolate is the way to go here. Semi-sweet and milk chocolate will make it more sweet and would thin it out a little more.
How To Make Chocolate Pastry Cream
The process for making this recipe is quite simple, but it is very hands-on. Be sure to read through the entire process before starting.

Gently whisk the egg yolks in a medium-sized bowl.

Whisk the sugar and cornstarch until there are no lumps of cornstarch.

Add the milk. Cook over medium heat, stirring continuously.

Cook just until it begins to thicken and simmer. Do not boil.

Temper the eggs by adding a bit of the hot milk to them, whisking constantly.

Add the eggs to the milk mixture and bring to a light boil.

Boil for 45 seconds to 1 minute, stirring continuously.

Remove from heat. Stir in the butter, vanilla, and chocolate.

Stir until the chocolate is smooth and melted.

Transfer to a bowl. Press clear wrap against the top. Refrigerate for 1-2 hours.
Once the pastry cream is fully chilled and you’re ready to use it, give it a good stir to smooth everything out.

Tips & Tricks for the Best Pastry Cream
- Gentle heat. When heating the sugar, cornstarch, and milk, be sure to keep it over medium heat (or medium-low) and stir continuously. You want it slowly begin to thicken and then come to a simmer, not a boil, before adding the eggs.
- Temper the eggs. You don’t want scrambled eggs. To prevent this, slowly stream some of the hot milk into the eggs, whisking constantly, before adding the eggs to the milk mixture. This helps them adjust to the temperature and stay smooth and creamy.
- Whisk constantly. You should always be whisking, from the time you start heating the milk mixture until the chocolate pastry cream is ready to chill. Things can overcook quickly and become lumpy if you stop.
- Quick boil only. Once the eggs are added to the mixture, it only needs to boil for 45 seconds to 1 minute. You want a slow boil, with large bubbles slowly popping on top. Boiling for too long or too quickly can cause it to separate. Boiling too long can also cause the cornstarch to break down and give you a loose pastry cream.
- Strain if needed. If your mixture seems a bit lumpy, you can strain it before transferring it to a bowl. This isn’t always necessary, especially if you follow the tips above, but don’t stress if you see a few lumps.
- Prevent film when chilling. To prevent a film from forming on top of the chocolate pastry cream while it chills, press clear wrap directly onto the surface.
- Stir before using. Once the pastry cream has chilled for a couple of hours and you’re ready to use it, just give it a good stir to smooth it out. Keep in mind that it will have thickened quite a bit.

Ways To Use It
This chocolate pastry cream works in so many different desserts! It works as a filling for eclairs, cream puffs, and other desserts made with choux pastry, piped inside vanilla cupcakes, or as a layer in a trifle (like this brownie trifle). It could also be used as a filling in chocolate layer cake.
Basically, any dessert that has a filling or uses vanilla pastry cream!
Proper Storage
Chocolate pastry cream can be stored in the fridge for 3-5 days. Once it has cooled in the bowl, transfer it to an airtight container. Just be sure to keep the plastic wrap pressed against the top to prevent a film from developing. I don’t recommend freezing it. It can separate and become watery once thawed.
More Filling & Frosting Recipes

Chocolate Pastry Cream
save this recipe
Enter your email & we’ll send it to your inbox. Plus get new recipes from us every week!
Ingredients
- 4 large egg yolks
- ¾ cup (155g) sugar
- 4 tablespoons (32g) cornstarch
- 2 cups (480ml) whole milk
- 2 tablespoons (28g) unsalted butter
- 2 teaspoons vanilla extract
- 4 ounces bittersweet chocolate (chopped)
Instructions
- Add the egg yolks to a medium sized bowl and gently beat them together. Set aside.
- Add the sugar and cornstarch to a large saucepan and whisk together until no more lumps of cornstarch remain, then add the milk.
- Cook, stirring continuously, over medium heat until mixture just begins to thicken and simmer. Be careful not to boil it.
- Stream a little bit of the milk mixture to the egg yolks, while whisking together continuously so that the eggs don’t scramble. Add the egg mixture to milk mixture, putting it all back in the pan. This process ensures that you don’t cook the egg yolks too quickly and get scrambled eggs.
- Place the pan back on the heat and bring to a light boil. You should see large bubbles slowly popping on top. Allow to boil for 45 seconds to 1 minute, stirring continuously. Don’t boil for too long, or you can overcook it and it’ll actually break down, rather than get thicker.
- Remove from heat and add the butter, vanilla extract and bittersweet chocolate. Stir until the chocolate is melted and smooth, then pour into a bowl. If it seems lumpy, you can strain it to remove any lumps. Cover with clear wrap pressed against the top so that it doesn’t get a film on top and set in the fridge to cool completely, 1-2 hours.
- When ready to use, stir the pastry cream until smooth. Best if used within 3-5 days.
Notes
- Milk – I don’t recommend substitutions here, as the high fat content in whole milk is necessary to maintain the thick and creamy texture.
- Chocolate – Using another type of chocolate, such as semi-sweet or milk chocolate, could make your pastry cream more thin. Semi-sweet chocolate should be fine, but milk chocolate isn’t ideal. It would also make the pastry cream a little too sweet.
Nutrition
The nutrition facts provided are calculated using a third-party tool and are estimates only. Actual nutritional content may vary based on the ingredients and brands you use, as well as portion sizes. For accurate results, please consult a registered dietitian or nutritionist.



