All-purpose flour is the most common flour called for in recipes, for both cooking and baking. But if you don't have any in the pantry, or can't find any in the store, there are other flours you can use in its place. Bread flour and cake flour—on their own or mixed together—can substitute for all-purpose. Just take note that each flour is best used in specific types of recipes.
Understanding Soft Flours vs. Hard Flours
Different kinds of flour exist for different purposes. For crusty breads and pizza, you want a strong flour with a high gluten content. For making pasta, you want an even harder flour. For soft, tender cakes and pastries, a lower gluten flour is the way to go.
All-purpose flour is a blend of hard and soft; it is hard enough to use for making bread but soft enough to use for making cakes. It's not the ideal flour for either one but eliminates the need to keep multiple bags of flour in your pantry.
Making a Substitution
Since all-purpose flour is a combination of soft and hard flours, a good substitution is a mixture of a soft flour, like cake flour, with a hard flour such as bread flour. To calculate how much you need of each, start with 1 cup of all-purpose flour, which weighs 130 grams. Then combine about 70 grams of bread flour with about 60 grams of cake flour. That will produce the middle-of-the-road compromise of all-purpose flour.
Professional bakers don't measure flour in cups but instead measure the flour by weight for more accuracy. Weighing the flours instead of using a measuring cup is important because bread flour and cake flour have different weights. So measuring by cup means you could wind up using too much or too little flour.
Swapping Is Not Always Necessary
Before you create this new version of all-purpose flour, consider whether it is absolutely necessary. For instance, if you're making pasta, bread, hard rolls, pizza dough, or other tough, crusty products, you can simply use bread flour. For cakes, pies, cookies, and any other pastries (including pancakes, muffins, and other quick breads), you can sub in cake flour.