We present a theoretical framework within which both the real and imaginary parts of the complex, two-photon exchange amplitude contributing to KL→μ+μ− decay can be calculated using lattice quantum chromodynamics. The real part of this two-photon amplitude is of approximately the same size as that coming from a second-order weak strangeness-changing neutral-current process. Thus a test of the standard model prediction for this second-order weak process depends on an accurate result of this two-photon amplitude. A limiting factor of our proposed method comes from low-energy three-particle ππγ states. The contribution from these states will be significantly distorted by the finite volume of our calculation—a distortion for which there is no available correction. However, a simple estimate of the contribution of these three-particle states suggests their contribution to be at most a few percent allowing their neglect in a lattice calculation with a 10% target accuracy. Published by the American Physical Society 2024