You can use coconut oil instead of butter at a ratio of 1:1, melted — one cup of coconut oil for one cup of butter, measured after melting. That is the simplest butter swap in this guide, and the reason is that coconut oil, like butter, is a solid fat at room temperature: it melts at about 24°C, so it behaves like butter in the bowl and in the oven in a way that liquid oils cannot. It is also the best dairy-free butter substitute for baking, because it is solid, it creams (after a fashion), it makes a flaky pastry, and it sets firm as it cools, just as butter does. What it adds is a mild coconut flavour — welcome in some recipes, intrusive in others — and what it lacks is butter's milk solids, which means it does not brown the same way.
Coconut oil has become the default butter substitute in vegan and dairy-free baking, and for good reason. A vegan chocolate chip cookie made with coconut oil is recognisably a chocolate chip cookie: it has crisp edges, a chewy centre, and a flavour that most people cannot distinguish from the butter version. A dairy-free pie crust made with coconut oil is flaky and tender. The swap is not perfect — nothing is — but it is the closest a plant-based fat comes to behaving like butter, and it is the one to learn first if you are baking without dairy.
The ratio, in a table
The table below converts butter to coconut oil for the amounts you are most likely to meet. The rule is always the same: equal amounts, with the coconut oil melted first if the recipe calls for melted butter, or softened to room temperature if the recipe calls for softened butter.
| Butter called for | Coconut oil to use | Notes |
|---|---|---|
| 1 tablespoon | 1 tablespoon | Melted or softened |
| 2 tablespoons | 2 tablespoons | |
| 1/4 cup | 1/4 cup | 60 ml melted |
| 1/3 cup | 1/3 cup | |
| 1/2 cup | 1/2 cup | 120 ml melted |
| 2/3 cup | 2/3 cup | |
| 3/4 cup | 3/4 cup | 180 ml melted |
| 1 cup | 1 cup | 240 ml melted |
| 1 1/2 cups | 1 1/2 cups | |
| 2 cups | 2 cups |
By weight, one cup of butter is 227 grams and one cup of melted coconut oil is 218 grams — close enough that you can swap them gram for gram in most recipes, using 227 grams of coconut oil for 227 grams of butter. Note that solid coconut oil packs at about 227 grams per cup, the same as butter, so if you are measuring the coconut oil solid, the weight matches exactly. The difference between the solid and melted weights is small, and either is fine — but be consistent: if the recipe was written in cups, measure the coconut oil the same way the recipe measures the butter.
Worked examples
Example 1: Vegan chocolate chip cookies that actually taste like cookies
A chocolate chip cookie recipe calls for 1/2 cup of butter — 113 grams. Replace it with 1/2 cup of coconut oil, softened to room temperature (not melted). Cream it with the sugar exactly as you would butter: it will not trap quite as much air, so the cookies will be a little denser, but they will have crisp edges and chewy centres. Use refined coconut oil if you do not want a coconut flavour, or unrefined if you like it — the chocolate will mostly cover it either way. Chill the dough for 30 minutes before baking, because coconut oil melts at a lower temperature than butter and the cookies will spread more if the dough is warm.
Example 2: A dairy-free pie crust
A pie crust recipe calls for 1 cup of butter, cut into cubes and rubbed into the flour. Replace it with 1 cup of solid coconut oil, chilled in the fridge until firm, then cut into cubes. Rub it into the flour the same way, add ice water, and chill the dough before rolling. The crust will be flaky and tender, with a very faint coconut note that disappears under a fruit filling. The key is temperature: coconut oil melts at 24°C, so work quickly, keep the dough cold, and chill it for 30 minutes before rolling. If your kitchen is warm, chill the flour and the bowl too.
Example 3: A coconut cake where the flavour is the point
A coconut cake recipe calls for 1 cup of butter, and you want the coconut flavour to shine. Replace it with 1 cup of unrefined coconut oil, melted, and use it in the batter. The cake will have a pronounced coconut flavour, a moist crumb, and a tender texture. This is the recipe where the substitution is not a compromise but an upgrade: the coconut oil does what butter cannot, which is to make the cake taste of coconut from the inside out. Top it with a coconut frosting and toasted coconut flakes, and the flavour is coherent from first bite to last.
What changes in the result
Three things change when you swap coconut oil for butter. First, the flavour: unrefined coconut oil adds a distinct coconut taste, while refined coconut oil is neutral. Choose unrefined when the coconut flavour is welcome (chocolate, tropical fruit, curry) and refined when it is not (vanilla cake, shortbread). Second, the texture: coconut oil makes a slightly denser, more tender crumb than butter, and it makes cookies spread more, because it melts at a lower temperature. Chilling the dough before baking fixes most of the spreading. Third, the keeping quality: coconut oil solidifies as it cools, so a cake made with coconut oil will firm up in the fridge the way a butter cake does — unlike a cake made with liquid oil, which stays soft. That is an advantage for anything that needs to hold its shape, and a disadvantage for anything you want to stay soft when cold.
The practical consequence is that coconut oil is the most versatile butter substitute in this guide. It is the only one that can plausibly replace butter in pastry, in cookies, and in cakes, because it is solid at room temperature. It is not identical to butter — it has no milk solids, so it does not brown, and it does not cream quite as well — but it is closer than any liquid oil, and for dairy-free baking it is the first choice.
When not to substitute
Do not use coconut oil instead of butter in recipes that rely on creaming butter with sugar for maximum lift, such as a Victoria sponge or an angel food cake — coconut oil does not trap air as well, and the cake will be denser. Do not use it in laminated pastry (croissants, puff pastry), where butter's specific melting behaviour and water content create the layers. Do not use unrefined coconut oil in a delicate vanilla or white cake, where its flavour will be intrusive — use refined instead. And do not use coconut oil if anyone eating the food has a coconut allergy, which is a tree-nut-adjacent allergy that some people have; in that case, use a different fat entirely.
One more caution: coconut oil is very high in saturated fat — higher than butter, in fact, at about 82 percent saturated fat compared with butter's 63 percent. If you are swapping for health reasons, coconut oil is not the right choice; olive oil or another unsaturated fat is better. The reason to use coconut oil is dairy-free baking and its solid-fat behaviour, not health.
Frequently asked questions
How much coconut oil do I use instead of 1 cup of butter?
Use 1 cup of coconut oil for 1 cup of butter — a 1:1 ratio, measured melted if the recipe calls for melted butter, or softened if it calls for softened butter. By weight, that is about 227 grams of solid coconut oil, or 218 grams melted. The 1:1 ratio works because coconut oil, like butter, is a solid fat at room temperature.
Should I use refined or unrefined coconut oil for baking?
Use refined coconut oil when you do not want a coconut flavour — in vanilla cakes, shortbread, and most cookies. Use unrefined (virgin) coconut oil when the coconut flavour is welcome — in chocolate cake, coconut cake, tropical bakes, and curries. Both swap 1:1 for butter, and both behave the same way in the oven; the only difference is flavour and a slightly lower smoke point for unrefined oil.
Can I use coconut oil instead of butter in pastry?
Yes, and it is one of the best dairy-free pastry fats. Chill the coconut oil until firm, cut it into cubes, and rub it into the flour the same way you would butter. Keep everything cold, because coconut oil melts at 24°C — lower than butter — and work quickly. The pastry will be flaky and tender, with a very faint coconut note that disappears under a filling.
Does coconut oil make cookies spread more?
Yes, a little. Coconut oil melts at a lower temperature than butter, so cookies made with it start spreading sooner in the oven. Chilling the dough for 30 minutes before baking fixes most of the spreading. You can also use slightly less oil — about 7/8 of the butter amount — if spreading is a persistent problem, though that changes the texture slightly.
Is coconut oil healthier than butter?
Not in terms of saturated fat — coconut oil is about 82 percent saturated fat, while butter is about 63 percent. Coconut oil is dairy-free and contains medium-chain triglycerides, which some people value, but it is still a calorie-dense saturated fat. The reason to use it is dairy-free baking and its solid-fat behaviour, not health. If health is the goal, olive oil is a better swap.
Can I melt coconut oil in the microwave?
Yes. Put it in a microwave-safe bowl and heat it in 15-second bursts, stirring between each, until it is just melted. Do not overheat it — coconut oil scorches easily, and overheated oil will taste bitter. You can also melt it in a small pan over low heat, or by standing the jar in a bowl of warm water.
Related links
- Olive oil instead of butter — the same idea, with a liquid oil.
- Margarine instead of butter — the other 1:1 solid-fat swap.
- Shortening instead of butter — the 1:1 swap for flaky pastry.
- Butter to oil converter — convert any amount of butter to oil instantly.
- Cups to grams for coconut oil — coconut oil weighs 218 g per cup melted.
- Cups to grams for butter — butter weighs 227 g per cup.
- Browse all substitutions — every butter, egg, milk and oil swap.
- Recipe scaler — scale the whole recipe after the swap.
