Cake and pastry fillings range from simple whipped cream to cooked custards, fruit compotes, and nut pastes. The right one depends on the texture you want—light and airy, rich and creamy, or firm enough to slice—and how long it must hold up before serving. Most fillings need to be made ahead, chilled, and sometimes stabilized so they don’t soak into the cake or pastry.
Ingredients
- 2 cups (480 ml) whole milk
- 1/2 cup (100 g) granulated sugar
- 1/4 cup (30 g) cornstarch
- 4 large egg yolks (pasteurized if you plan to eat the filling raw)
- 2 tsp vanilla extract
- 2 tbsp (28 g) unsalted butter, cut into small pieces
- 1 cup (240 ml) heavy cream, cold
- 2 tbsp (15 g) powdered sugar
Instructions
- In a medium saucepan, whisk together the milk, sugar, and cornstarch. Cook over medium heat, stirring constantly, until the mixture thickens and comes to a gentle boil, about 5–7 minutes. It should be thick enough to coat the back of a spoon.
- In a small bowl, lightly beat the egg yolks. Gradually whisk about 1 cup of the hot milk mixture into the yolks to temper them, then pour the yolk mixture back into the saucepan.
- Return to medium heat and cook, stirring constantly, until the mixture thickens further and just begins to bubble, about 2–3 minutes. The internal temperature should reach 160°F (71°C) per USDA FSIS safe minimum for egg dishes.
- Remove from heat and stir in the vanilla and butter until smooth. Pour through a fine-mesh sieve into a clean bowl to remove any lumps.
- Cover with plastic wrap pressed directly onto the surface to prevent a skin from forming. Refrigerate until completely cold, at least 2 hours or up to 3 days.
- When ready to use, whip the heavy cream and powdered sugar in a chilled bowl until soft peaks form. Gently fold the whipped cream into the cold pastry cream until no streaks remain. Use immediately or refrigerate for up to 24 hours.
What Makes a Filling Work for Cakes vs. Pastries
Cakes need fillings that are thick enough not to squish out between layers. Pastry cream, stabilized whipped cream, and firm fruit compotes work well. For delicate pastries like cream puffs or éclairs, a lighter filling—pastry cream lightened with whipped cream—is ideal because it pipes easily and doesn’t weigh down the shell.
Buttercream frostings are also used as fillings, but they are much sweeter and firmer. If you want a less sweet option, use the pastry cream recipe above.
Substitutions for Common Filling Ingredients
- Milk: Use half-and-half or a mix of milk and cream for a richer filling. Reduce the butter by half if you use cream.
- Cornstarch: Replace with 1/4 cup (30 g) all-purpose flour, but cook the mixture 2 minutes longer to eliminate the raw flour taste.
- Vanilla: Use 1 vanilla bean, split and scraped, steeped in the milk for 15 minutes before cooking.
- Heavy cream: For a dairy-free version, use chilled coconut cream, but note it will have a coconut flavor.
- Egg yolks: For a leaner filling, omit the yolks and increase cornstarch to 1/3 cup (40 g). The filling will be less rich and slightly more gelatinous.
How to Prevent a Skin and Keep It Smooth
Always press plastic wrap directly onto the surface of hot pastry cream. If a skin does form, whisk it vigorously before folding in the whipped cream. For extra smoothness, strain the cooked cream through a sieve—this catches any cooked egg bits.
If the filling seems too thick after chilling, whisk in 1–2 tablespoons of milk to loosen it. If it’s too thin, fold in an additional 1/2 cup of whipped cream to lighten it, but not to thicken it—for thickening, return it to the stove and cook with a little cornstarch slurry.
Make-Ahead Timeline for Cake Filling
You can make the pastry cream base up to 3 days ahead. Keep it refrigerated in an airtight container. The whipped cream should be folded in no more than 24 hours before filling your cake, as it will start to deflate. If you need to fill a cake more than 24 hours ahead, use a stabilized whipped cream or a firm buttercream instead.
Storing Filled Cakes and Pastries
Any cake or pastry filled with this cream must stay refrigerated. Cover loosely with plastic wrap or a cake dome; it will keep for 3–4 days. Do not leave it at room temperature for more than 2 hours total (1 hour if above 90°F/32°C).
You can freeze unfilled pastry cream for up to 1 month. Thaw overnight in the fridge, then whisk before folding in fresh whipped cream. Once the cream is folded in, do not freeze—the texture will break.
Can You Use This Filling in Cream Puffs or Éclairs?
Yes. The lightened version (with whipped cream) pipes easily into choux pastry. For cream puffs, fill them just before serving to keep the shells crisp. For éclairs, you can fill them a few hours ahead, but the shells may soften slightly. If you prefer crisp shells, fill them no more than 1 hour before serving.
For a firmer filling that holds its shape when sliced, skip the whipped cream and use the pastry cream as is. It will be denser but still creamy.
Related
- Phyllo Puff Pastry Recipes: 3 Easy Ways
- Apple Pie with Phyllo Pastry: Crisp Layers, Easy Method
- Earthquake Cake with Cream Cheese Filling
Safe minimum internal temperatures follow USDA FSIS; raw-fish guidance follows the U.S. FDA. See our food safety notes.
Spotted an error? Tell us and we will correct it (corrections policy).