Crustal thickness is a critical parameter for understanding the processes of continental rifting and breakup and the evolution of petroleum systems within passive margins. However, direct measurements of crustal thickness are sparse and expensive, highlighting the need for methodologies using gravity anomaly data, jointly with other geophysical data, to estimate crustal thickness. We evaluated alternative gravity inversion methodologies to map crustal thickness variations at rifted continental margins and adjacent oceanic basins, and we tested our methodology in the South China Sea (SCS). Different strategies were investigated to estimate and remove the gravity effect of density variations of sediments and the temperature and pressure variations of the lithospheric mantle from the observed free air gravity anomaly data. Sediment density was calculated using a relationship between sediment thickness, porosity, and density. We found that this method is essential for crustal thickness inversion in the presence of a thick sedimentary cover by comparing the Moho depths obtained from gravity inversion and seismic interpretation in the Yinggehai Basin where sediments are up to 13 km thick; the inversion accuracy depended on the parameters of the exponential equation between porosity and the buried depth. We modeled the lithospheric mantle temperature field based on oceanic crustal age, continental crustal stretching factors, and other boundary conditions. We tested three different methods to calculate the thermal expansion coefficient, which is either held constant or is a linear/polynomial function of temperature, for applying a thermal correction and found that the inversion results were relatively insensitive to alternative methods. We compared inversion results with two recent deep seismic profiles that image the rifted continental edge at the northern margin of the SCS and the continental Liyue Bank (Reed Bank) at the southern margin, and we found that the inversion accuracy was improved considerably by removing sediment, thermal, and pressure gravity effects.