Abstract. An algorithm setup for the operational Aerosol Layer Height product for TROPOMI on the Sentinel-5 Precursor mission is described and discussed, applied to GOME-2A data, and evaluated with lidar measurements. The algorithm makes a spectral fit of reflectance at the O2 A band in the near-infrared and the fit window runs from 758 to 770 nm. The aerosol profile is parameterised by a scattering layer with constant aerosol volume extinction coefficient and aerosol single scattering albedo and with a fixed pressure thickness. The algorithm's target parameter is the height of this layer. In this paper, we apply the algorithm to observations from GOME-2A in a number of systematic and extensive case studies, and we compare retrieved aerosol layer heights with lidar measurements. Aerosol scenes cover various aerosol types, both elevated and boundary layer aerosols, and land and sea surfaces. The aerosol optical thicknesses for these scenes are relatively moderate. Retrieval experiments with GOME-2A spectra are used to investigate various sensitivities, in which particular attention is given to the role of the surface albedo. From retrieval simulations with the single-layer model, we learn that the surface albedo should be a fit parameter when retrieving aerosol layer height from the O2 A band. Current uncertainties in surface albedo climatologies cause biases and non-convergences when the surface albedo is fixed in the retrieval. Biases disappear and convergence improves when the surface albedo is fitted, while precision of retrieved aerosol layer pressure is still largely within requirement levels. Moreover, we show that fitting the surface albedo helps to ameliorate biases in retrieved aerosol layer height when the assumed aerosol model is inaccurate. Subsequent retrievals with GOME-2A spectra confirm that convergence is better when the surface albedo is retrieved simultaneously with aerosol parameters. However, retrieved aerosol layer pressures are systematically low (i.e., layer high in the atmosphere) to the extent that retrieved values no longer realistically represent actual extinction profiles. When the surface albedo is fixed in retrievals with GOME-2A spectra, convergence deteriorates as expected, but retrieved aerosol layer pressures become much higher (i.e., layer lower in atmosphere). The comparison with lidar measurements indicates that retrieved aerosol layer heights are indeed representative of the underlying profile in that case. Finally, subsequent retrieval simulations with two-layer aerosol profiles show that a model error in the assumed profile (two layers in the simulation but only one in the retrieval) is partly absorbed by the surface albedo when this parameter is fitted. This is expected in view of the correlations between errors in fit parameters and the effect is relatively small for elevated layers (less than 100 hPa). If one of the scattering layers is near the surface (boundary layer aerosols), the effect becomes surprisingly large, in such a way that the retrieved height of the single layer is above the two-layer profile. Furthermore, we find that the retrieval solution, once retrieval converges, hardly depends on the starting values for the fit. Sensitivity experiments with GOME-2A spectra also show that aerosol layer height is indeed relatively robust against inaccuracies in the assumed aerosol model, even when the surface albedo is not fitted. We show spectral fit residuals, which can be used for further investigations. Fit residuals may be partly explained by spectroscopic uncertainties, which is suggested by an experiment showing the improvement of convergence when the absorption cross section is scaled in agreement with Butz et al. (2013) and Crisp et al. (2012), and a temperature offset to the a priori ECMWF temperature profile is fitted. Retrieved temperature offsets are always negative and quite large (ranging between −4 and −8 K), which is not expected if temperature offsets absorb remaining inaccuracies in meteorological data. Other sensitivity experiments investigate fitting of stray light and fluorescence emissions. We find negative radiance offsets and negative fluorescence emissions, also for non-vegetated areas, but from the results it is not clear whether fitting these parameters improves the retrieval. Based on the present results, the operational baseline for the Aerosol Layer Height product currently will not fit the surface albedo. The product will be particularly suited for elevated, optically thick aerosol layers. In addition to its scientific value in climate research, anticipated applications of the product for TROPOMI are providing aerosol height information for aviation safety and improving interpretation of the Absorbing Aerosol Index.