In this paper we present an a posteriori error analysis for elliptic homogenization problems discretized by the finite element heterogeneous multiscale method. Unlike standard finite element methods, our discretization scheme relies on macro- and microfinite elements. The desired macroscopic solution is obtained by a suitable averaging procedure based on microscopic data. As the macroscopic data (such as the macroscopic diffusion tensor) are not available beforehand, appropriate error indicators have to be defined for designing adaptive methods. We show that such indicators based only on the available macro- and microsolutions (used to compute the actual macrosolution) can be defined, allowing for a macroscopic mesh refinement strategy which is both reliable and efficient. The corresponding a posteriori estimates for the upper and lower bound are derived in the energy norm. In the case of a uniformly oscillating tensor, we recover the standard residual-based a posteriori error estimate for the finite element method applied to the homogenized problem. Numerical experiments confirm the efficiency and reliability of the adaptive multiscale method.