It is in the börek family of pastries with a filling of chopped spinach, fetacheese, onions or scallions, egg, and seasoning. The filling is wrapped or layered in phyllo (filo) pastry with butter and/or olive oil, either in a large pan from which individual servings are cut, or rolled into individual triangular servings (see burek). While the filo-dough recipe is most common, many recipes from the Greek islands call for a crust made of flour and water to form a crunchier, calzone-like exterior in place of the flaky filo dough. The pastry is golden in color when baked, the color often enhanced by butter and egg yolk. Other white, fresh, preferably salted cheeses may also be mixed with, or substituted for, the feta cheese.
It is mostly eaten as a snack in Greece, and it can be an alternative to tyropita. It can be served straight from the oven or at room temperature. There is a "fasting", or vegan, version of spanakopita, eaten during the Great Lent and other religious fasts, and composed of spinach, onions or green onions, other green herbs like dill, parsley or celery, olive oil and a little wheat flour, but without eggs or dairy products; the mixture is oven-baked until crisp. Non-traditional vegan versions are available that typically use tofu instead of cheese.
In rural Greece, smaller amounts of spinach are used, with the missing part substituted with leeks, chard and sorrel.