S U M M A R YIn this paper, we present the finite cube elements method (FCEM); a novel numerical tool for calculating the gravity anomaly g and structural index SI of solid models with defined boundaries and variable density distributions, tilted or in normal position (e.g. blocks, faulted blocks, cylinders, spheres, hemispheres, triaxial ellipsoids). Extending the calculation to fractal objects, such as Menger sponges of different orders and bodies defined by polyhedrons, demonstrates the robustness of FCEM. In addition, approximating the cube element by a sphere of equal volume makes the calculation of gravitation and related derivatives much simpler. In gravity modelling of a sphere, cubes with edges of 100 m and 200 m achieve a good compromise between running time and overall error.Displaying the distribution of SI of the studied models on contour maps and profiles will have a strong impact on the forward and inverse modelling of potential field data, especially for Euler deconvolution.For Menger sponges, plots of gravity elements g and its derivatives show similar patterns independent of fractal order. Moreover, both the pattern and magnitude of SI are independent of fractal order, allowing the use of SI as a new invariant measure for fractal objects. However, SI pattern and magnitude strongly depend on the depth to the buried bodies as do other elementsIn this study, we also present a new type of plot; the structural index against distance variation diagrams from which we extract the three critical SI (CSI) values, one per axis. The inversion of gravity anomaly data at CSI values gives the optimal mean location of the buried body.