Large-scale studies of the spatial and temporal variation of groundwater drought status require complete inventories of groundwater levels on regular time steps from many sites so that a standardised drought index can be calculated for each site. However, groundwater levels are often measured sporadically, and inventories include missing or erroneous data. A flexible and efficient modelling framework is developed to fill gaps and regularise data in such inventories. It uses linear mixed models to account for seasonal variation, long-term trends and responses to precipitation and temperature over different temporal scales. The only data required to estimate the models are the groundwater level measurements and freely available gridded weather products. The contribution of each of the four types of trends at a site can be determined and thus the causes of temporal variation of groundwater levels can be interpreted. Validation reveals that the models explain a substantial proportion of groundwater level variation and that the uncertainty of the predictions is accurately quantified. The computation for each site takes less than 130 s and requires little supervision. Hence, the approach is suitable to be upscaled to represent the variation of groundwater levels in large datasets consisting of thousands of boreholes.