The structure of water near non-polar molecular fragments or surfaces mediates the hydrophobic interactions that underlie a broad range of interfacial, colloidal and biophysical phenomena. Substantial progress over the past decade has improved our understanding of hydrophobic interactions in simple model systems, but most biologically and technologically relevant structures contain non-polar domains in close proximity to polar and charged functional groups. Theories and simulations exploring such nanometre-scale chemical heterogeneity find it can have an important effect, but the influence of this heterogeneity on hydrophobic interactions has not been tested experimentally. Here we report chemical force microscopy measurements on alkyl-functionalized surfaces that reveal a dramatic change in the surfaces' hydrophobic interaction strengths on co-immobilization of amine or guanidine groups. Protonation of amine groups doubles the strength of hydrophobic interactions, and guanidinium groups eliminate measurable hydrophobic interactions in all pH ranges investigated. We see these divergent effects of proximally immobilized cations also in single-molecule measurements on conformationally stable β-peptides with non-polar subunits located one nanometre from either amine- or guanidine-bearing subunits. Our results demonstrate the importance of nanometre-scale chemical heterogeneity, with hydrophobicity not an intrinsic property of any given non-polar domain but strongly modulated by functional groups located as far away as one nanometre. The judicious placing of charged groups near hydrophobic domains thus provides a strategy for tuning hydrophobic driving forces to optimize molecular recognition or self-assembly processes.