Easy vegan pastry cream sets quickly and holds its shape without eggs or dairy. It has the same rich, custard-like flavor and smooth texture as traditional versions, using cornstarch and plant milk. This recipe works for éclairs, fruit tarts, cream puffs, or as a filling for layer cakes.
Stir Constantly to Prevent Lumps
Pastry cream thickens when starch in cornstarch gelatinizes with heat, but only if you stir it the entire time. Without stirring, the mixture burns on the bottom and forms lumps on top. Use a flat-bottomed silicone spatula or a balloon whisk to scrape the entire surface of the saucepan. Keep the heat at medium to avoid scorching while still reaching the temperature needed for thickening.
Ingredients
- 3/4 cup (180 ml) unsweetened plain soy milk (or oat milk for nuttier flavor)
- 1/2 cup (120 ml) full-fat canned coconut milk (from the top of the can, not light)
- 1/4 cup (50 g) granulated sugar
- 3 tablespoons (24 g) cornstarch
- 1/8 teaspoon fine sea salt
- 1 1/2 teaspoons (7 ml) pure vanilla extract
- 1 tablespoon (14 g) refined coconut oil or neutral oil (optional, for shine and richness)
Instructions
- Combine 1/2 cup (120 ml) of the soy milk, the coconut milk, sugar, cornstarch, and salt in a medium saucepan. Whisk until no lumps remain and the mixture is smooth. Add the remaining 1/4 cup (60 ml) soy milk last to adjust thickness if needed.
- Place the saucepan over medium heat. Stir constantly with a silicone spatula or whisk. The mixture will begin to thicken at around 3 minutes. Continue stirring as it heats.
- At 5–6 minutes, the mixture will start to bubble. Once it reaches a full, rolling boil, continue boiling and stirring for exactly 1 minute. This ensures the cornstarch is fully cooked and the cream will set when cooled.
- Remove from heat. Stir in the vanilla extract and coconut oil (if using). The oil adds a silky mouthfeel and helps prevent a skin from forming.
- Pour the pastry cream into a bowl. Press a piece of parchment paper or plastic wrap directly onto the surface to prevent a skin. Chill for at least 2 hours before using.
Skim Off Any Skin That Forms
If a skin forms despite covering the surface, scoop it off with a spoon before using. A skin forms when steam escapes and dries the top layer. It’s safe to eat but has a different texture. If you plan to pipe the cream, a smooth base without lumps or skin is essential for consistent flow through a pastry bag.
Do not skip chilling. The cream thickens fully only when cold. If used warm, it will be too soft and may leak from pastries. After 2 hours, check that the center is firm to the touch and holds an indentation without collapsing.
Equipment and Substitutions
What to Use Instead of a Saucepan
A heavy-bottomed 2-quart (2-liter) saucepan prevents scorching. If you don’t have one, use a small pot with thick walls. Avoid nonstick if it’s scratched—starch can catch in the grooves. A glass or ceramic pot works but heats more slowly; increase time by 1–2 minutes.
Plant Milk Swaps
Soy milk works best because it has the highest protein, which helps with structure. Oat milk adds creaminess but can make the filling slightly softer. Almond milk is thinner and may require an extra 1/2 teaspoon of cornstarch. Rice milk is too thin and not recommended. Use plain, unsweetened versions to control sugar and avoid flavor clash.
Cornstarch Substitute
Arrowroot powder can replace cornstarch at a 1:1 ratio by volume, but the cream sets softer and doesn’t hold as long. Tapioca starch also works at 1:1 but gives a slightly stretchy texture. Do not use flour—it won’t thicken enough and leaves a raw taste even after cooking.
Sugar Options
Coconut sugar or cane sugar work at 1:1 by volume. Granulated monk fruit or erythritol blends can replace sugar cup for cup if they dissolve fully. Liquid sweeteners like maple syrup add moisture; reduce the soy milk by 1 tablespoon for every 1/4 cup (60 ml) of syrup used.
Vanilla Alternatives
Use 1/2 teaspoon almond extract for a nutty note, or 1/2 teaspoon lemon zest for brightness. Avoid imitation vanilla—it can leave a chemical aftertaste when heated.
Cooling and Storage Times
Refrigerate pastry cream within 2 hours of cooking. Store in an airtight container with a piece of parchment pressed on the surface. It keeps for 4 days in the refrigerator. Do not freeze—the texture breaks down and becomes watery when thawed.
If using in a dessert that will sit at room temperature, assemble no more than 2 hours before serving (1 hour if above 90°F/32°C). Fill pastries just before serving if possible to prevent sogginess.
For make-ahead use, prepare the cream up to 3 days in advance. Check for separation before using. If liquid pools on top, stir gently to recombine. Discard if the smell is sour or off.
Fixing Common Problems
Cream Is Too Thin
If the cream doesn’t thicken after boiling, return it to the stove. Mix 1 teaspoon cornstarch with 1 tablespoon cold soy milk into a slurry. Whisk into the cream and bring back to a boil for 1 minute. Chill again.
Cream Is Lumpy
Press the cream through a fine-mesh sieve using a spatula. This removes lumps without thinning the texture. To prevent lumps next time, sift the cornstarch into the dry ingredients and whisk the mixture thoroughly before heating.
Cream Tastes Starchy
This happens if the cornstarch isn’t boiled for a full minute. The raw starch flavor disappears only with sustained boiling. Always bring the mixture to a full, bubbling boil and time 60 seconds exactly.
Cream Separates
Separation occurs if the coconut milk was not well mixed before measuring. Shake the can vigorously before opening. If separation happens, whisk the chilled cream until smooth. If oil pools on top, stir it back in or skim it off.
Related
- Lemon Filling for Danish Pastry: Tangy, Creamy & Perfect for Baking
- How to Make Banana Vegan Ice Cream
- Lemon Cream Cheese Danish with Puff Pastry
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).