We present a unifying theory of fields with certain classes of analytic functions, called fields with analytic structure. Both real closed fields and Henselian valued fields are considered. For real closed fields with analytic structure, o-minimality is shown. For Henselian valued fields, both the model theory and the analytic theory are developed. We give a list of examples that comprises, to our knowledge, all principal, previously studied, analytic structures on Henselian valued fields, as well as new ones. The b-minimality is shown, as well as other properties useful for motivic integration on valued fields. The paper is reminiscent of [Denef, van den Dries, p-adic and real subanalytic sets. Ann. of Math. (2) 128 (1988) 79–138], of [Cohen, Paul J. Decision procedures for real and p-adic fields. Comm. Pure Appl. Math. 22 (1969)131–151], and of [Fresnel, van der Put, Rigid analytic geometry and its applications. Progress in Mathematics, 218 Birkhäuser (2004)], and unifies work by van den Dries, Haskell, Macintyre, Macpherson, Marker, Robinson, and the authors.