Magnetostatic forces computation can be done numerically through Finite Element Analysis by applying the virtual works method on either the energy or the co-energy. They can also be computed analytically using Maxwell's tensor. Different results have been obtained using these two procedures. In this work we will introduce a general way of obtaining magnetostatic stress tensors (Maxwell's tensors) from either the energy or the co-energy. Both tensors are equivalent in induced magnetisation media (media whose magnetisation depends on an external magnetic field), but they are different in permanent magnets (media whose magnetisation does not depend on an external magnetic field). In these media, normal components of the surface forces derived from either the energy or the co-energy are the same, but tangential components have different modules, keeping the same direction as the tangential components of magnetic field H or magnetic induction B respectively. Force density is also different. Forces computed from co-energy do not have the same conservative characteristic as forces computed from energy. The application of Maxwell tensors in the calculation of forces over the real surface of magnetic media must take into account the discontinuity of the forces from one medium (particularly a vacuum) to another. Generally, normal stresses in all media, obtained from the energy and the co-energy, are discontinuous, while tangential stresses are only discontinuous in processes derived from the co-energy in permanent magnets.