Quadrature amplitude modulation (QAM) is an attractive technique to achieve high rate transmission without increasing the bandwidth. A great deal of attention has been devoted to the study of bit error rate (BER) performance of QAM, and approximate expressions for the bit error probability of QAM have been developed in many places in the literature. However, the exact and general BER expression of QAM with an arbitrary constellation size has not been derived yet. We provide an exact and general closed-form expression of the BER for one-dimensional and two-dimensional amplitude modulations, i.e., PAM and QAM, under an additive white Gaussian noise (AWGN) channel when Gray code bit mapping is employed. The provided BER expressions offer a convenient way to evaluate the performance of PAM and QAM systems for various cases of practical interest. Moreover, simple approximations can be found from our expressions, which are the same as the well-known approximations, if only the dominant terms are considered.