A new model of seismic coda is presented, based on the balance between the energy scattered from the direct wave and the energy in the seismic coda. This energy-flux model results in a simple formula for the amplitude and time decay of the seismic coda that explicitly differentiates between the scattering and intrinsic (anelastic) attenuation of the medium. This formula is valid for both weak and strong scattering and implicitly includes multiple scattering. The model is tested using synthetic seismograms produced in finite difference simulations of wave propagation through media with random spatial variations in seismic velocity. Some of the simulations also included intrinsic dissipation. The energy-flux model explains the coda decay and amplitude observed in the synthetics, for random media with a wide range of scattering Q. In contrast, the single-scattering model commonly used in the analysis of microearthquake coda does not account for the gradual coda decay observed in the simulations for media with moderate or strong scattering attenuation (scattering Q ≦ 150). The simulations demonstrate that large differences in scattering attenuation cause only small changes in the coda decay rate, as predicted by the energy-flux model. The coda decay rate is sensitive, however, to the intrinsic Q of the medium. The ratio of the coda amplitude to the energy in the direct arrival is a measure of the scattering attenuation. Thus, analysis of the decay rate and amplitude of the coda can, in principle, produce separate estimates for the scattering and intrinsic Q values of the crust. We analyze the coda from two earthquakes near Anza, California. Intrinsic Q values determined from these seismograms using the energy-flux model are comparable to coda Q values found from the single-scattering theory. These results indicate that coda Q values are, at best, measures of the intrinsic Q of the lithosphere and are unrelated to the scattering Q.