We test an improved finite-size scaling method for reliably extracting the critical temperature TBKT of a Berezinskii–Kosterlitz–Thouless (BKT) transition. Using known single-parameter logarithmic corrections to the spin stiffness ρs at TBKT in combination with the Kosterlitz–Nelson relation between the transition temperature and the stiffness, ρs(TBKT) = 2TBKT/π, we define a size-dependent transition temperature TBKT(L1,L2) based on a pair of system sizes L1,L2, e.g., L2 = 2L1. We use Monte Carlo data for the standard two-dimensional classical XY model to demonstrate that this quantity is well behaved and can be reliably extrapolated to the thermodynamic limit using the next expected logarithmic correction beyond the ones included in defining TBKT(L1,L2). For the Monte Carlo calculations we use GPU (graphical processing unit) computing to obtain high-precision data for L up to 512. We find that the sub-leading logarithmic corrections have significant effects on the extrapolation. Our result TBKT = 0.8935(1) is several error bars above the previously best estimates of the transition temperature, TBKT ≈ 0.8929. If only the leading log-correction is used, the result is, however, consistent with the lower value, suggesting that previous works have underestimated TBKT because of the neglect of sub-leading logarithms. Our method is easy to implement in practice and should be applicable to generic BKT transitions.