Abstract Based on gravity data, with aims to evaluate the effectiveness of Bayesian inference for subsurface target detection in situations where the spatial position and shape of underground targets are unknown, we perform modeling and analysis in terms of regional measurement and line measurement scenarios. The results show that Bayesian method for gravity gradient detection outperforms microgravity detection and can lead to a good parameter prediction quality.