Accelerograms are the primary source for characterizing strong ground motion. It is therefore of paramount interest to have high‐quality recordings free from any nonphysical contamination. Frequently, accelerograms are affected by baseline jumps and drifts, either related to the instrument and/or a major earthquake. In this work, I propose a correction method for these undesired baseline drifts based on segmented linear least squares. The algorithm operates on the integrated waveforms and combines all three instrument components to estimate a model that modifies the baseline to be at zero continuously. The procedure consists of two steps: first a suite of models with variable numbers of discontinuities is derived for all three instrument components. During this process, the number of discontinuities is reduced in a parsimonious way, for example, two very close discontinuities are merged into a single one. In the second step, the optimal model is selected on the basis of the Bayesian information criterion. I exemplify the application on synthetic waveforms with known discontinuities and on observed waveforms from a unified strong‐motion database of the Japan Meteorological Agency (JMA) and the National Research Institute for Earth Science and Disaster Prevention (NIED, Japan) networks for the major events of the 2016 Kumamoto earthquakes. After the baseline jump correction, the waveforms are furthermore corrected for displacement according to Wang et al. (2011). The resulting displacements are comparable to the Interferometric Synthetic Aperture Radar‐derived displacement estimates for the Kumamoto earthquake sequence.