Logging-while-drilling (LWD) resistivity responses are inevitably contaminated by Gaussian and non-Gaussian noise. Noise contamination can influence the stability and accuracy of the inversion of the data. In addition, the uncertainty of the bed-boundary positions can complicate the inversion. We have developed a novel efficient nonlinear inversion algorithm, called Huber inversion, to accurately estimate the layer-by-layer resistivity when LWD measurements were affected by Gaussian and non-Gaussian noise. Huber inversion combines the advantages of the [Formula: see text]- and [Formula: see text]-norm inversions, which are more robust than the traditional least-squares inversion algorithm. We use a multiple initial bed-boundary positions method to reduce the inversion uncertainty caused by uncertain bed-boundary positions. The initial bed-boundary positions could be restricted into defined ranges based on the investigation depth of LWD instruments, the geologic environment, and log data from adjacent wells. The slipping inversion window technique is also adopted to satisfy the real-time requirements and ensure that the inversion parameters are the global optima. Numerical simulations under different conditions demonstrate the high stability and superiority of the proposed method. Reliable inversion results can be used for routine petrophysical interpretation, accurate geosteering, and quantitative formation evaluation.