Baseline drift widely exists in the spectral measurements due to instrumental nonlinearity. It negatively affects the qualitative or quantitative analysis of chemical and physical parameters, thus, an accurate baseline estimation is needed. An improved algorithm, optimized asymmetric least squares smoothing (O-ALS), is designed based on the traditional ALS algorithm to achieve effective estimation. First, an appropriate smooth factor is selected according to the number of second-order concave points (NSCP) of a measured spectrum. Then, the asymmetric penalty factor is adaptively optimized in each iteration based on the differences between the estimated baseline and the measured spectrum. Various simulated and real measured data, including Fourier Transform Spectrometer spectrum, chromatogram, and ion mobility spectroscopy, have been used for evaluation. All results achieve a high precision, which suggests that our algorithm is effective, flexible, and robust.