Due to the good balance between file size and visual quality, JPEG images are widely used in our daily lives. Many reversible data hiding (RDH) schemes have been developed for JPEG images, most of which are based on the modification of one-dimensional (1D) histograms of DCT coefficients. Recently, two-dimensional (2D) histograms of DCT coefficients are used to improve embedding efficiency. However, the existing coefficient pairing, coefficient pair mapping and embedding order can be further optimized. In this paper, a new RDH scheme for JPEG images based on 2D histogram modification is proposed. First, according to the statistical distribution of the AC coefficients, two non-zero coefficients with the same frequency in adjacent blocks, instead of two neighboring coefficients within the same block, are paired. More coefficient pairs with higher embedding efficiency can be obtained. Then, an optimized coefficient pair mapping is presented, more specifically, the coefficient pairs that occur more frequently are given priority to use the transfer mode with higher embedding efficiency. Lastly, a new method is proposed to accurately estimate the embedding efficiency of different frequencies. The data is embedded into the coefficient pairs at the frequency position where the embedding efficiency is higher. Extensive experiments on several commonly-used images and two popular image databases show that our proposed scheme can achieve better visual quality and smaller file size increments compared to the state-of-the-art RDH schemes for JPEG images. (C) 2022 Elsevier B.V. All rights reserved.