Home » Cake Recipes » Pastry Cream Recipe
Collage shows creamy vanilla pastry filling swirled in a glass bowl, bold pastry filling text overlay, and thick custard cream layered over soft sponge cake slice on a white plate.

Vanilla Pastry Cream Recipe

Vanilla pastry cream is a thick, smooth custard made with whole milk, egg yolks, sugar and cornstarch, cooked on the stove and finished with butter and vanilla. It takes about 20 minutes plus 2 hours in the fridge and makes about 2½ cups, enough to fill a two layer cake, a tray of éclairs or a 9 inch fruit tart.

The French call it crème pâtissière. The one thing that decides whether it sets or runs is simple: once it thickens, let it bubble and keep whisking for another minute or two.

Collage shows bowl of smooth vanilla pastry cream, vanilla pastry filling text overlay, and cream filled eclair pastries topped with glossy icing on white plate.

Following a special diet?

Every recipe on this site can be converted to gluten-free, vegan, dairy-free, keto, nut-free or egg-free with adjusted ratios so nothing falls flat.

Try the Recipe Converter →

What Goes Into 2½ Cups of Pastry Cream

  • Milk: 2 cups (480 ml) whole milk
  • Eggs: 4 large egg yolks and 1 whole egg
  • Sugar and starch: ½ cup (100 g) granulated sugar and ¼ cup (30 g) cornstarch
  • To finish: 2 tablespoons (30 g) unsalted butter and 1½ teaspoons pure vanilla extract, or 1 vanilla bean
  • Time: 10 minutes prep, about 10 minutes cooking, at least 2 hours chilling
  • Yield: about 2½ cups
  • Keeps: 3 days in the fridge

Why a Whole Egg Joins the Four Yolks

Baking ingredients for vanilla pastry cream arranged on marble surface with milk, eggs, butter cubes, sugar, vanilla extract, and small bowls prepared for homemade custard filling recipe.

Yolks bring the richness and the yellow color. The one whole egg adds a little extra structure from its white, so the cream holds a clean line when you pipe it but still tastes light. Cornstarch does the real thickening. It sets the custard firm enough to slice inside a cake once it is cold.

Use whole milk. Its fat is what makes the cream taste round and full; low fat milk gives a thinner, flatter result. Sugar does more than sweeten. Whisked into the yolks first, it raises the temperature at which they set, which gives you a bit of breathing room when the hot milk goes in. The butter goes in last, off the heat, for gloss and a softer mouthfeel.


Vanilla Bean or Extract?

Either works, but pick one. With extract, stir in 1½ teaspoons at the end, off the heat, so the flavor does not cook away. With a bean, split it, scrape the seeds into the milk, drop in the pod too, and let it steep off the heat for 10 minutes. You get the tiny black specks and a deeper, rounder flavor, and you skip the extract. Pull the pod out before the milk goes into the eggs.


Tempering the Eggs Without Scrambling Them

Warm milk pours into beaten eggs in glass bowl to start classic vanilla custard base for homemade pastry cream filling.

Heat the milk in a heavy saucepan until it steams and small bubbles form at the edge, just below a simmer. A heavy pan matters here. Thin pans get hot spots, and the custard catches on the bottom.

While the milk steeps, whisk the sugar, cornstarch, yolks and whole egg in a bowl until thick, pale and smooth. Any dry pockets of cornstarch become lumps later, so be thorough.

Now pour about half the hot milk into the eggs in a thin stream, whisking the whole time. Slow is the point. All at once, the yolks cook into little yellow specks before they are diluted.


Cook Until It Bubbles, Then One More Minute

Whisk mixes smooth vanilla custard in stainless steel saucepan creating thick glossy pastry cream texture for homemade dessert filling.

Pour the egg mixture back into the pan with the rest of the milk and set it over medium heat. Use a balloon whisk, not a spoon, and keep it moving across the bottom and into the corners. For a few minutes nothing happens. Then it thickens quickly, and you will feel the whisk drag.

Keep going. Wait until big, slow bubbles break the surface, then whisk for another 1 to 2 minutes. The cream turns from thick and dull to glossy and slightly looser. This is the step most runny pastry cream skips. Egg yolks contain an enzyme that breaks down starch, and only a real boil stops it. Pull the pan too early and the cream looks fine tonight but is thin by morning.

Fine mesh strainer pours thick vanilla custard into clear glass bowl to create smooth lump free pastry cream for cake filling and dessert recipes.

Take the pan off the heat and whisk in the butter, and the vanilla extract if you did not use a bean. Push the cream through a fine mesh sieve into a clean bowl. Even a smooth looking batch leaves a few cooked bits behind.

Press plastic wrap right onto the surface so no skin forms. Spreading it in a shallow dish helps it chill faster. Refrigerate for at least 2 hours, until cold and set.


Using It as a Vanilla Custard Cake Filling

Collage shows bowl of silky vanilla pastry cream swirl, pastry cream recipe text overlay, and thick custard cream spread over fluffy sponge cake slice.

Cold pastry cream sets quite firm. Beat it with a whisk or a mixer for 20 to 30 seconds and it turns smooth and spreadable again. Do not add milk to loosen it, or it will squeeze out of the cake.

Pipe a ring of buttercream around the edge of each layer first. That dam holds the soft custard in. Spread about 1 cup inside it on an 8 or 9 inch layer, add the next cake layer, and chill the whole cake for at least an hour before slicing. A light vanilla sponge cake is a natural match, and this is the same filling idea behind a Boston cream pie. Because it is egg and dairy, a filled cake lives in the fridge.


Filling Éclairs, Cream Puffs and Fruit Tarts

For chocolate éclairs and cream puffs, beat the chilled cream smooth, spoon it into a piping bag with a small round tip, and fill the shells through a small hole until they feel heavy. Fill them close to serving so the pastry stays crisp.

For a fruit tart, spread the cream into a fully baked, cooled tart shell and arrange the fruit on top. A thin layer of melted jam brushed over the fruit keeps it shiny and stops it drying out.


Pastry Cream vs Custard vs Crème Anglaise

They start from the same eggs, sugar and milk. What changes is the starch, and how firm the result is:

  • Crème anglaise: no starch, cooked gently and never boiled. A pourable vanilla sauce.
  • Baked custard: eggs and milk set in the oven, as in a custard pie or crème caramel.
  • Pastry cream: thickened with cornstarch and boiled, so it sets firm enough to pipe and slice.
  • Diplomat cream: pastry cream lightened with whipped cream. See my diplomat cream recipe.
  • Bavarian cream: custard set with gelatin and folded with whipped cream, like this Bavarian cream.

Lumpy, Runny or Curdled Pastry Cream

  • Lumps: the cornstarch was not fully whisked into the eggs, or the whisk stopped at the bottom of the pan. Push the hot cream through a sieve, or blend it for a few seconds.
  • Thin after chilling: it never reached a full boil. Return it to the pan, bring it back to bubbling while whisking, cook 1 more minute, then strain and chill again.
  • Grainy or curdled: the milk went into the eggs too fast, or the heat was too high. Sieve it; small specks strain out, but a fully split batch is best started again.
  • Rubbery and stiff: it is simply cold. Whisk it hard and it relaxes.

Chocolate, Coffee, Lemon and Almond Versions

Keep the base recipe the same and change only the flavor. For chocolate pastry cream, stir about 3 ounces (85 g) chopped dark chocolate into the hot cream with the butter. For coffee, dissolve 1 to 2 teaspoons instant espresso powder in the warm milk. For lemon or orange, steep the zest of one fruit in the milk with the vanilla. For almond, add ¼ teaspoon almond extract with the vanilla.

If you want a nutty filling that bakes inside a tart instead, frangipane is the almond cream for that job.


Making Pastry Cream Ahead

Pastry cream keeps for up to 3 days in the fridge in an airtight container with the plastic still pressed to the surface. Make it the day before you assemble a cake or fill pastries, and whisk it smooth just before using. Freezing is not a good idea: cornstarch custards weep and turn spongy when they thaw.


Quick Answers on Crème Pâtissière

Can I use all yolks instead of the whole egg?

Yes. Swap the whole egg for 2 more yolks. The cream will be a little richer and slightly softer.

Can I use flour instead of cornstarch?

You can, but use about twice as much and cook it a little longer. Flour gives a less glossy cream with a faint cereal taste.

Why does my pastry cream taste starchy?

It was not cooked long enough after it thickened. The 1 to 2 minutes of whisking at a boil cooks out that raw cornstarch taste.

Yield: About 2 1/2 cups (600 ml)

Vanilla Pastry Cream Recipe

Collage shows creamy vanilla pastry filling swirled in a glass bowl, bold pastry filling text overlay, and thick custard cream layered over soft sponge cake slice on a white plate.

This vanilla pastry cream is a thick, smooth custard filling made with whole milk, egg yolks, one whole egg, sugar, cornstarch, butter and vanilla. It cooks in about 10 minutes, chills for 2 hours and makes about 2 1/2 cups, set firm enough to pipe and slice. The key is to let the cream bubble and keep whisking for 1 to 2 minutes after it thickens, so the cornstarch fully cooks and the custard does not thin out overnight. Use this crème pâtissière as a vanilla custard cake filling, in éclairs and cream puffs, under fresh fruit in a tart, or in a Boston cream pie. Fold in whipped cream for diplomat cream. It keeps 3 days in the fridge; do not freeze.

Prep Time 10 minutes
Cook Time 10 minutes
Additional Time 2 hours
Total Time 2 hours 20 minutes

Ingredients

  • 2 cups (480 ml) whole milk
  • 1/2 cup (100 g) granulated sugar
  • 1/4 cup (30 g) cornstarch
  • 4 large egg yolks
  • 1 whole egg
  • 2 tablespoons (30 g) unsalted butter
  • 1 1/2 teaspoons pure vanilla extract
  • Optional: 1 vanilla bean, split and scraped

Instructions

  1. HEAT THE MILK: In a medium saucepan, heat the milk over medium heat until it is just below a simmer. If using a vanilla bean, add the seeds and pod to the milk while it heats. Once warm, remove from heat and let it steep for 10 minutes to infuse the flavor.
  2. WHISK THE EGGS AND SUGAR: In a mixing bowl, whisk together the sugar, cornstarch, egg yolks, and whole egg until the mixture is thick, pale, and smooth. This helps prevent lumps and creates a silky base.
  3. TEMPER THE EGGS: Slowly pour about half of the hot milk into the egg mixture, whisking constantly to prevent curdling. This gradually raises the temperature of the eggs without cooking them.
  4. COOK THE PASTRY CREAM: Pour the tempered egg mixture back into the saucepan with the remaining milk. Return the pan to medium heat and whisk constantly as the mixture thickens. Continue to whisk for 1–2 minutes after it thickens to fully cook out the cornstarch.
  5. FINISH THE CREAM: Remove from heat and whisk in the butter and vanilla extract, unless you already used a vanilla bean. Strain the cream through a fine mesh sieve into a clean bowl to ensure a perfectly smooth texture.
  6. CHILL: Press a piece of plastic wrap directly onto the surface of the cream to prevent a skin from forming. Refrigerate for at least 2 hours, or until completely chilled and set.

Notes

Whisk the cornstarch thoroughly into the eggs and sugar so no dry pockets remain. Pour the hot milk into the eggs slowly while whisking. Once the cream thickens, wait for large bubbles to break the surface and keep whisking for 1 to 2 more minutes; undercooked pastry cream turns thin in the fridge. Use either a vanilla bean or the vanilla extract, not both. Chilled pastry cream sets firm, so whisk it smooth before piping or spreading; do not thin it with milk. For a cake filling, pipe a buttercream dam around each layer. Store airtight in the refrigerator with plastic wrap pressed on the surface for up to 3 days. Not suitable for freezing.

Leave a Comment

Your email address will not be published. Required fields are marked *

*