Steganography is the art and science of hiding data in different media such as texts, audios, images, and videos. Data hiding techniques are generally divided into two groups: spatial and frequency domain techniques. Spatial domain methods generally have low security and, as a result, are less attractive to researchers. Discrete cosine transform (DCT) is the most common transform domain used in steganography and JPEG compression. Since a large number of the DCT coefficients of JPEG images are zero, the capacity of DCT domain-based steganography methods is not very high. We present a high-capacity method for hiding messages in the DCT domain. We describe the method in two classes where the receiver has and where the receiver does not have the cover image. In each class, we consider three cases for each coefficient. By considering coefficients, there are different situations. The method embeds bits in these coefficients. We show that the maximum reachable capacity by our method is 58% higher than the other general steganography methods. Experimental results show that the histogram-based steganalysis methods cannot detect the stego images produced by the proposed method while the capacity is increased significantly.