With thousands of varieties of apples out there, it can be hard to choose the best apples for apple pie. But the fact remains: Some apples are better suited for baking than others. That’s not to say there’s no place for other apples; many that are poorly suited for pie-making are wonderful for boiling down into applesauce or apple butter—or biting straight into (we’re looking at you, Fuji, Red Delicious, and McIntosh). However, baking a perfect apple pie calls for specific criteria to ensure success, and it all comes down to two basic pillars: flavor and texture.

The goal is a type of apple that will soften in the oven until tender, yet keep its shape and maintain some textural bite, rather than becoming a mushy, mealy mess. “I like to see the apple pieces even after it’s cooked down a lot,” says Sarah Sanneh, co-owner of Brooklyn’s Pies ‘n’ Thighs. Former BA food editor Claire Saffitz (whose prolific apple desserts include Apple Pandowdy, Apple-Walnut Upside Down Cake, and Caramel Apple Clafoutis) offers a simple tip for shopping: If you press on an apple with your thumb and it’s so firm that you don’t leave an indent, that’s a solid baking apple.

Flavor-wise, a nice balance of sweet and tart will lead to a balanced profile in your homemade apple pie, creating that irresistible combo that keeps pie lovers coming back for another bite. One other note: Feel free to mix and match apple varieties for a custom pie. Burying more than one type of apple beneath that flaky crust will yield a filling that’s so good you may be tempted to skip the vanilla ice cream (don’t skip the vanilla ice cream). Now on to the fruit!

Granny Smith Apples

This ubiquitous green variety is one of the most tart apples, and a favorite apple among professional bakers. It boasts a bright, citrus-like aroma, with substantial acidity that complements the added sugar in pie recipes. The flesh is firm and crunchy and holds up well under long bake times.

Another reason the pros love Granny Smiths? They’re widely available year-round, so they’re great for bakeries that go through large amounts of apples and are looking to offer a consistently delicious product every time.

Braeburn Apples

Streaks of red, orange, and green collide in this cousin of Granny Smith, which features a similarly citrusy nose. “This superbly crisp apple has a concentrated taste and bakes up juicy but not mushy,” says food director Chris Morocco. With a pronounced sweet flavor against a tart backdrop, these apples provide extra crispness with minimal graininess, softening in the oven while maintaining enough texture. Their flavor sweetens and concentrates during cooking to evoke a hint of spice, making them a natural pick for pie. And since they don’t release much liquid during cooking, Braeburns won’t lead to a runny filling or soggy pie crust.

Pink Lady Apples

According to Morocco, Pink Lady apples strike the ideal balance between “sweet, tart, and tannic notes.” The apples hold their firm structure in the oven and don’t turn to mush, with the bonus of an appealing rosy hue. As another aesthetic win: They’re slower to oxidize and the sliced apples won’t brown as quickly on your counter, so you can leisurely prep without stress. That juicy sweet-tartness that makes them such a refreshing snacking apple comes through in the final dessert, like in BA’s best apple pie recipe that’s made in a deep-dish pie pan.

Pink Lady is a personal favorite of Christa Campbell of Rainbow Orchards in Camino, California, where they sell an array of apple-centric goodies including pies. “They keep that divine sweet-tart flavor and have the perfect oh-so-soft crunch and juiciness when baked,” she says.