This invention relates to phytases, polynucleotides encoding them, uses of the polynucleotides and polypeptides of the invention, as well as the production and isolation of such polynucleotides and polypeptides. In particular, the invention provides polypeptides having phytase activity under high temperature conditions, and phytases that retain activity after exposure to high temperatures. The invention further provides phytases which have increased gastric lability. The phytases of the invention can be used in foodstuffs to improve the feeding value of phytate rich ingredients. The phytases of the invention can be formulated as foods or feeds or supplements for either to, e.g., aid in the digestion of phytate.