We consider inflationary magnetogenesis where the conformal symmetry is broken by the term f2(φ) Fαβ Fαβ. We assume that the magnetic field power spectrum today between 0.1 and 104 Mpc is a power law, with upper and lower limits from observation. This fixes f to be close to a power law in conformal time in the window during inflation when the modes observed today are generated. In contrast to previous work, we do not make any assumptions about the form of f outside these scales. We cover all possible reheating histories, described by an average equation of state −1/3 < bar w < 1. Requiring that strong coupling and large backreaction are avoided both at the background and perturbative level, we find the bound δB0 < 5 ×10−15 (r/0.07)1/2 κG for the magnetic field generated by inflation, where r is the tensor-to-scalar ratio and κ is a constant related to the form of f. This estimate has an uncertainty of one order of magnitude related to our approximations. The parameter κ is < 100, and values gsim 1 require a highly fine-tuned form of f; typical values are orders of magnitude smaller.