What is the formula of volume for a square pyramid?

One-third times the area of the base times the height:

1/3 x (LW) x h

In the case of a square pyramid, the length and width of the base are the same, so you could rewrite the formula as:

1/3 x s2 x h

where s = the length of one side of the base